Function Migration Method and Apparatus

ABSTRACT

A method for function migration includes a first device that sends a first request carrying an identifier of the first device to a second device. The second device receives the first request from the first device. The second device sends a first response to the first device, where the first response indicates a first group created by the second device, and a member in the first group includes the second device. The first device receives the first response from the second device. The first device sends a second request to the second device, where the second request is for applying for adding the first device to the first group. The first device migrates a first function in a first application to the second device, where the first application is any application in the first device, and the first function includes one or more graphical user interfaces.

CROSS-REFERENCE TO RELATED APPLICATIONS

This is a continuation of International Patent Application No.PCT/CN2022/083204 filed on Mar. 25, 2022, which claims priority toChinese Patent Application No. 202110351292.3 filed on Mar. 31, 2021.The disclosures of the aforementioned applications are herebyincorporated by reference in their entireties.

TECHNICAL FIELD

This disclosure relates to the field of terminals, and in particular, toa function migration method and an apparatus.

BACKGROUND

With popularization and development of digital devices such assmartphones, tablet computers, and personal computers (PCs), a quantityof personal terminals increases sharply, and requirements for sharingservice data between different devices are imposed. Therefore, how toshare the service data and ensure security and reliability of the databecomes a problem to be urgently resolved.

SUMMARY

Embodiments of this disclosure provide a function migration method andan apparatus, to ensure security and reliability of data sharing.

According to a first aspect, an embodiment of this disclosure provides afunction migration method, applied to a first device, where the methodincludes sending a first request to a second device, where the firstrequest carries an identifier of the first device, an identifier of afirst application, and an identifier of a second application, receivinga first response from the second device, where the first responseindicates a first group created by the second device, and a member inthe first group includes the second application of the second device,sending a second request to the second device, where the second requestis for applying for adding the first application of the first device tothe first group, and migrating a first function in the first applicationto the second application of the second device, where the first functionincludes one or more graphical user interfaces (UIs).

According to the method provided in this embodiment of this disclosure,the first application of the first device and the second application ofthe second device may join the first group, through negotiation betweenthe first device and the second device, in other words, members in thefirst group may include the first application of the first device andthe second application of the second device. Because the first group iscreated through the negotiation between the first device and the seconddevice, migrating function data between the members in the first group,for example, migrating the one or more UIs of the first function, canensure security and reliability of data sharing.

In a possible implementation, the first response includes a personalidentification number (PIN) corresponding to the first group and/orcommunication connection information of the second device, and sending asecond request to the second device includes sending the second requestto the second device based on the PIN and/or the communicationconnection information of the second device. In this way, when the firstdevice needs to join the group created by the second device, the PINcorresponding to the group may be carried in the request, so that thesecond device may check security of the first device based on the PIN,to ensure the security and the reliability of the data sharing.

In a possible implementation, the method further includes receiving asecond response, where the second response indicates that the firstapplication of the first device has joined the first group. In this way,the first device may learn that the first application has joined thefirst group, so that the function migration can be directly performedsubsequently.

In a possible implementation, the method further includes creating asecond group, where members in the second group include the firstapplication of the first device and the second application of the seconddevice. In other words, the first device may locally create a group(namely, the second group), and the group is the same as the groupcreated by the second device. In this way, when the second applicationof the second device migrates a function to the first application of thefirst device, if the first device determines that the second group islocally stored, the first device may consider that the secondapplication of the second device is secure and trusted, and the functionmigration can be directly performed.

In a possible implementation, the method further includes displaying afirst pop-up box in response to a first operation performed by a user onthe first application of the first device, where the first pop-up boxincludes an identifier of a device that is in a same network as thefirst device, and sending a first request to a second device includessending the first request to the second device in response to a secondoperation of selecting the second device by the user in the first pop-upbox. In this way, the user may select, through the first pop-up box, thedevice to which the function needs to be migrated.

In a possible implementation, the device that is in the same network asthe first device includes a trusted device and an untrusted device,where the trusted device includes a device that logs in to a sameaccount as the first device, a device that has performed device-levelauthentication with the first device, or a device that has performedapplication-level authentication with the first application of the firstdevice, and the untrusted device includes a device that does not log into the same account as the first device, a device that has not performeddevice-level authentication with the first device, or a device that hasnot performed application-level authentication with the firstapplication of the first device. In this way, the trusted device and theuntrusted device may be notified to the user, to help the user manage acorresponding device.

In a possible implementation, the method further includes scanning atwo-dimensional code image displayed by the second device, where thetwo-dimensional code image includes the PIN corresponding to the firstgroup and/or the communication connection information of the seconddevice, and sending a second request to the second device includessending the second request to the second device based on the PIN and/orthe communication connection information of the second device. Anexample in which an identifier is the two-dimensional code image is usedherein for description. The two-dimensional code image may be replacedwith another type of identifier, for example, a bar code or a characterstring. This is not limited in this disclosure.

In a possible implementation, migrating a first function in the firstapplication to the second device includes sending service information ofthe first function to the second device, where when the firstapplication is a live streaming application, the service information ofthe first function includes at least one of a video stream, an audiostream, and bullet screen information of a live streaming studio of thefirst device, when the first application is a photographing application,the service information of the first function includes a photographingpreview image or menu bar information of a photographing interface, whenthe first application is a karaoke application, the service informationof the first function includes at least one of a song title, lyrics,audio information of a song, video information of the song, and acontrol interface of the song, when the first application is a shoppingapplication, the service information of the first function includescommodity information in a shopping cart, or when the first applicationis a mailbox application, the service information of the first functionincludes at least one of a subject, text, and an attachment of ane-mail.

In this way, in different scenarios, a part of functions of differentapplications (for example, the live streaming application, thephotographing application, the karaoke application, the mailboxapplication, or the shopping application) on the first device may bemigrated to the second device, so that a requirement for cross-devicefunction migration can be met.

In a possible implementation, the communication connection informationof the second device includes a WI-FI address or a BLUETOOTH address ofthe second device.

In a possible implementation, the method further includes sending athird request to a third device, where the third request carries theidentifier of the first device, a package name of the first application,and a package name of a third application, and requests to migrate thefirst function of the first application to the third application of thethird device, receiving a third response, where the third responseincludes information indicating that the migration is agreed to and agroup name of a third group created by the third device, and members inthe third group include the first application of the first device andthe third application of the third device, sending a fourth request tothe third device, where the fourth request is for applying for joiningthe third group, and includes the group name of the third group, andmigrating the first function in the first application to the thirddevice.

In a possible implementation, the method further includes updating themember in the locally stored first group, where members in an updatedfirst group include the first application of the first device, thesecond application of the second device, and the third application ofthe third device.

In a possible implementation, a package name of the second applicationis the same as the package name of the first application.

In a possible implementation, the trusted device includes the thirddevice, and a group related to the third device is deleted in responseto an operation of deleting the third device from the trusted device bythe user.

In a possible implementation, the first group is set to be permanentlyvalid or valid within a preset period of time.

In a possible implementation, when the first application is the karaokeapplication, the method further includes re-orchestrating a song pick-upcontrol UI, and sending song pick-up or song cut-off information to thesecond device in response to a song pick-up or song cut-off operationperformed by the user in the song pick-up control UI.

In a possible implementation, when the first application is the shoppingapplication, the service information of the first function includes thecommodity information in the shopping cart, and the commodityinformation includes at least one of a commodity name, a commodity link,and commodity price information.

In a possible implementation, when the first application is the mailboxapplication, the service information of the first function includes theat least one of a subject, text, and an attachment of an e-mail.

According to a second aspect, an embodiment of this disclosure providesa function migration method, applied to a second device, where themethod includes receiving a first request from a first device, where thefirst request carries an identifier of the first device, an identifierof a first application, and an identifier of a second application,creating a first group, where a member in the first group includes thesecond application of the second device, sending a first response to thefirst device, where the first response indicates the first group,receiving a second request from the first device, where the secondrequest is for applying for adding the first application of the firstdevice to the first group, and receiving a first function that is in thefirst application and that is migrated by the first device, where thefirst function includes one or more graphical UIs.

According to the method provided in this embodiment of this disclosure,the first application of the first device and the second application ofthe second device may join the first group, through negotiation betweenthe first device and the second device, in other words, members in thefirst group may include the first application of the first device andthe second application of the second device. Because the first group iscreated through the negotiation between the first device and the seconddevice, migrating function data between the members in the first group,for example, migrating the one or more UIs of the first function, canensure security and reliability of data sharing.

In a possible implementation, the first response includes a PINcorresponding to the first group and/or communication connectioninformation of the second device. In this way, the second device maycheck security of the first device based on the PIN, to ensure thesecurity and the reliability of the data sharing.

In a possible implementation, the method further includes sending asecond response to the first device, where the second response indicatesthat the first application of the first device has joined the firstgroup. In this way, the first device may learn that the firstapplication has joined the first group, so that the function migrationcan be directly performed subsequently.

In a possible implementation, after receiving a first request from afirst device, the method further includes displaying a first pop-up box,where the first pop-up box notifies a user whether to agree to add thefirst application of the first device to the first group, and receivingan agreement instruction from the user. In this way, the user may benotified through the first pop-up box to add the first application ofthe first device to the first group.

In a possible implementation, before creating a first group, the methodfurther includes determining, based on the identifier of the firstdevice, that the second device currently has no second group, wheremembers in the second group include the first device and the seconddevice. To be specific, when it is determined that no group is createdbetween the first device and the second device, in other words, when notrusted connection was previously established between the first deviceand the second device, the first group may be created.

In a possible implementation, before creating a first group, the methodfurther includes determining, based on the identifier of the firstdevice, the identifier of the first application, and the identifier ofthe second application, that the second device currently has no thirdgroup, where members in the third group include the first application ofthe first device and the second application of the second device. To bespecific, when it is determined that no group is created between thefirst application of the first device and the second application of thesecond device, in other words, when no trusted connection was previouslyestablished between the first application of the first device and thesecond application of the second device, the first group may be created.

In a possible implementation, the method further includes displaying atwo-dimensional code image, where the two-dimensional code imageincludes the PIN corresponding to the first group and/or thecommunication connection information of the second device. An example inwhich an identifier is the two-dimensional code image is used herein fordescription. The two-dimensional code image may be replaced with anothertype of identifier, for example, a bar code or a character string. Thisis not limited in this disclosure.

In a possible implementation, receiving a first function that is in thefirst application and that is migrated by the first device includesreceiving service information of the first function from the firstdevice, where when the first application is a live streamingapplication, the service information of the first function includes atleast one of a video stream, an audio stream, and bullet screeninformation of a live streaming studio of the first device, when thefirst application is a photographing application, the serviceinformation of the first function includes a photographing preview imageor menu bar information of a photographing interface, when the firstapplication is a karaoke application, the service information of thefirst function includes at least one of a song title, lyrics, audioinformation of a song, video information of the song, and a controlinterface of the song, when the first application is a shoppingapplication, the service information of the first function includescommodity information in a shopping cart, or when the first applicationis a mailbox application, the service information of the first functionincludes at least one of a subject, text, and an attachment of ane-mail.

In this way, in different scenarios, a part of functions of differentapplications (for example, the live streaming application, thephotographing application, the karaoke application, the mailboxapplication, or the shopping application) on the first device may bemigrated to the second device, so that a requirement for cross-devicefunction migration can be met.

In a possible implementation, the communication connection informationof the second device includes a WI-FI address or a BLUETOOTH address ofthe second device.

In a possible implementation, a package name of the second applicationis the same as a package name of the first application.

In a possible implementation, the first group is set to be permanentlyvalid or valid within a preset period of time.

In a possible implementation, after receiving a first request from afirst device, the method further includes displaying a second pop-upbox, where the second pop-up box notifies the user whether to agree tomigrate the first function to the second device by the first device.

In a possible implementation, if the live streaming application isinstalled on the second device, the second device detects whether thelive streaming application is logged in to, and if the live streamingapplication is in a logged-in state, the live streaming applicationpresents the first function on a live streaming image of the seconddevice.

In a possible implementation, if the live streaming application is notinstalled on the second device, the second device presents the firstfunction by using an audio player.

In a possible implementation, when the first application is thephotographing application, the service information of the first functionincludes the photographing preview image and the menu bar information ofthe photographing interface.

In a possible implementation, the second device displays thephotographing preview image of the first device and the menu bar of thephotographing interface of the first device, and sends a photographinginstruction to the first device in response to an operation oftriggering, by the user on the second device, the first device to take aphotograph. The first device photographs a picture or a video.

In a possible implementation, when the first application is the karaokeapplication, if the karaoke application is installed on the seconddevice, it is detected whether the karaoke application is logged in to,and if the karaoke application is in a logged-in state, the karaokeapplication presents the first function.

In a possible implementation, when the first application is the karaokeapplication, if the karaoke application is not installed on the seconddevice, the first function is presented by using an audio player.

In a possible implementation, when the first application is the shoppingapplication, if the shopping application is installed on the seconddevice, it is detected whether the shopping application is logged in to,and if the shopping application is in a logged-in state, the shoppingapplication displays a shared shopping cart based on the serviceinformation of the first function, where the shared shopping cartincludes all commodities in a shopping cart of the second device and allcommodities in the shopping cart of the first device.

In a possible implementation, the second device sends a payment requestto the first device in response to an operation of settling accounts ofall the commodities in the shared shopping cart by the user, where thepayment request includes a total amount of money of all the commoditiesin the shopping cart of the first device.

In a possible implementation, when the first application is the mailboxapplication, if the mailbox application is installed on the seconddevice, it is detected whether the mailbox application is logged in to,and if the mailbox application is in a logged-in state, the mailboxapplication presents the first function.

In a possible implementation, when the first application is the mailboxapplication, if the mailbox application is not installed on the seconddevice, the first function is encoded and rearranged by using animage-text editor for displaying.

According to a third aspect, an embodiment of this disclosure provides afunction migration method, applied to a communication system including afirst device and a second device, where the method includes thefollowing. The first device sends a first request to the second device,where the first request carries an identifier of the first device. Thesecond device receives the first request from the first device. Thesecond device sends a first response to the first device, where thefirst response indicates a first group created by the second device, anda member in the first group includes the second device. The first devicereceives the first response from the second device. The first devicesends a second request to the second device, where the second request isfor applying for adding the first device to the first group. The firstdevice migrates a first function in a first application to the seconddevice, where the first application is any application in the firstdevice, and the first function includes one or more graphical UIs.

In a possible implementation, the first response includes a PINcorresponding to the first group and/or communication connectioninformation of the second device. Sending a second request to the seconddevice includes sending the second request to the second device based onthe PIN and/or the communication connection information of the seconddevice. The method further includes receiving a second response from thesecond device, where the second response indicates that the first devicehas joined the first group.

In a possible implementation, the first device displays a first pop-upbox in response to a first operation performed by a user, where thefirst pop-up box includes an identifier of one or more devices that havenot performed authentication with the first device. That the firstdevice sends a first request to the second device includes sending thefirst request to the second device in response to a second operation ofselecting the second device by the user in the first pop-up box.

In a possible implementation, the method further includes the following.The first device creates a second group, where members in the secondgroup include the first device and the second device.

In a possible implementation, the method further includes the following.The first device displays the first pop-up box in response to the firstoperation performed by the user on the first application of the firstdevice, where the first pop-up box includes an identifier of a devicethat is in a same network as the first device. That the first devicesends a first request to the second device includes the following. Thefirst device sends the first request to the second device in response tothe second operation of selecting the second device by the user in thefirst pop-up box.

In a possible implementation, the device that is in the same network asthe first device includes a trusted device and an untrusted device,where the trusted device includes a device that logs in to a sameaccount as the first device, a device that has performed device-levelauthentication with the first device, or a device that has performedapplication-level authentication with the first application of the firstdevice, and the untrusted device includes a device that does not log into the same account as the first device, a device that has not performeddevice-level authentication with the first device, or a device that hasnot performed application-level authentication with the firstapplication of the first device.

In a possible implementation, the method further includes the following.The second device displays a two-dimensional code image, where thetwo-dimensional code image includes the PIN corresponding to the firstgroup and/or the communication connection information of the seconddevice. The first device scans the two-dimensional code image displayedby the second device. That the first device sends a second request tothe second device includes the following. The first device sends thesecond request to the second device based on the PIN and/or thecommunication connection information of the second device.

In a possible implementation, that the first device migrates a firstfunction in a first application to the second device includes sendingservice information of the first function to the second device, wherewhen the first application is a live streaming application, the serviceinformation of the first function includes at least one of a videostream, an audio stream, and bullet screen information of a livestreaming studio of the first device, when the first application is aphotographing application, the service information of the first functionincludes a photographing preview image or menu bar information of aphotographing interface, when the first application is a karaokeapplication, the service information of the first function includes atleast one of a song title, lyrics, audio information of a song, videoinformation of the song, and a control interface of the song, when thefirst application is a shopping application, the service information ofthe first function includes commodity information in a shopping cart, orwhen the first application is a mailbox application, the serviceinformation of the first function includes at least one of a subject,text, and an attachment of an e-mail.

According to a fourth aspect, an embodiment of this disclosure providesa function migration method, applied to a first device, where the methodincludes creating a first group, where a member in the first groupincludes a first application of the first device, receiving a firstrequest from a second device, where the first request is for applyingfor adding a second application of the second device to the first group,adding the second application of the second device to the first group,and migrating a first function in the first application to the secondapplication of the second device, where the first function includes oneor more graphical UIs.

In a possible implementation, before receiving a first request from asecond device, the method further includes displaying a first identifierindicating the first group, where the first request corresponds to thefirst identifier.

In a possible implementation, the first identifier includes atwo-dimensional code image, and includes a PIN. After receiving a firstrequest from a second device, the method further includes determiningthat the first request carries the PIN, and determining to add thesecond application of the second device to the first group.

In a possible implementation, migrating a first function in the firstapplication to the second application of the second device includessending service information of the first function to the second device,where when the first application is a live streaming application, theservice information of the first function includes at least one of avideo stream, an audio stream, and bullet screen information of a livestreaming studio of the first device, when the first application is aphotographing application, the service information of the first functionincludes a photographing preview image or menu bar information of aphotographing interface, when the first application is a karaokeapplication, the service information of the first function includes atleast one of a song title, lyrics, audio information of a song, videoinformation of the song, and a control interface of the song, when thefirst application is a shopping application, the service information ofthe first function includes commodity information in a shopping cart, orwhen the first application is a mailbox application, the serviceinformation of the first function includes at least one of a subject,text, and an attachment of an e-mail.

According to a fifth aspect, an embodiment of this disclosure provides afunction migration method, applied to a second device, where the methodincludes sending a first request to a first device, where the firstrequest is for applying for adding a second application of the seconddevice to a first group created by the first device, and members in thefirst group include a first application of the first device and thesecond application of the second device, and receiving a first functionin the first application from the first device, where the first functionincludes one or more graphical UIs.

In a possible implementation, before sending a first request to a firstdevice, the method further includes scanning a first identifierindicating the first group, where the first request corresponds to thefirst identifier.

In a possible implementation, the first identifier includes atwo-dimensional code image, and includes a PIN, and sending a firstrequest to a first device includes sending the first request to thefirst device, where the first request carries the PIN.

In a possible implementation, receiving a first function in the firstapplication from the first device includes receiving service informationof the first function from the first device, where when the firstapplication is a live streaming application, the service information ofthe first function includes at least one of a video stream, an audiostream, and bullet screen information of a live streaming studio of thefirst device, when the first application is a photographing application,the service information of the first function includes a photographingpreview image or menu bar information of a photographing interface, whenthe first application is a karaoke application, the service informationof the first function includes at least one of a song title, lyrics,audio information of a song, video information of the song, and acontrol interface of the song, when the first application is a shoppingapplication, the service information of the first function includescommodity information in a shopping cart, or when the first applicationis a mailbox application, the service information of the first functionincludes at least one of a subject, text, and an attachment of ane-mail.

According to a sixth aspect, this disclosure provides a first device,including one or more processors and one or more memories. The one ormore memories are coupled to the one or more processors. The one or morememories are configured to store computer program code, and the computerprogram code includes computer instructions. When the one or moreprocessors execute the computer instructions, the first device isenabled to perform the method in any possible implementation of thefirst aspect, the third aspect, or the fourth aspect.

According to a seventh aspect, this disclosure provides a second device,including one or more processors and one or more memories. The one ormore memories are coupled to the one or more processors. The one or morememories are configured to store computer program code, and the computerprogram code includes computer instructions. When the one or moreprocessors execute the computer instructions, the second device isenabled to perform the method in any possible implementation of thesecond aspect, the third aspect, or the fifth aspect.

According to an eighth aspect, an embodiment of this disclosure providesa computer program product. When the computer program product runs on acomputer, the computer is enabled to perform the method in any possibleimplementation of any one of the foregoing aspects.

According to a ninth aspect, this disclosure provides a chip system. Thechip system may be disposed in a first device. The chip system includesone or more interface circuits and one or more processors. The interfacecircuit and the processor are connected to each other through a line.The chip system may be used in an electronic device including acommunication module and a memory. The interface circuit is configuredto receive a signal from the memory and send the received signal to theprocessor, where the signal includes computer instructions stored in thememory. When the processor executes the computer instructions, the firstdevice may perform the method in any one of the foregoing aspects andthe possible implementations of the foregoing aspects.

According to a tenth aspect, an embodiment of this disclosure provides acomputer storage medium, including computer instructions. When thecomputer instructions are run on a first device, the first device isenabled to perform the method in any possible implementation of any oneof the foregoing aspects.

According to an eleventh aspect, an embodiment of this disclosureprovides a function migration system, including at least two devices(for example, a first device and a second device), and each device mayperform the method in any one of the foregoing aspects and the possibleimplementations of the foregoing aspects.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic diagram of a system architecture according to anembodiment of this disclosure;

FIG. 2 is a schematic diagram of another system architecture accordingto an embodiment of this disclosure;

FIG. 3 is a schematic diagram of a hardware structure of an electronicdevice according to an embodiment of this disclosure;

FIG. 4 is a schematic diagram of a software architecture of anelectronic device according to an embodiment of this disclosure;

FIG. 5A and FIG. 5B are a schematic diagram of displaying according toan embodiment of this disclosure;

FIG. 5C and FIG. 5D are another schematic diagram of displayingaccording to an embodiment of this disclosure;

FIG. 5E and FIG. 5F are another schematic diagram of displayingaccording to an embodiment of this disclosure;

FIG. 5G and FIG. 5H are another schematic diagram of displayingaccording to an embodiment of this disclosure;

FIG. 5I, FIG. 5J, and FIG. 5K are another schematic diagram ofdisplaying according to an embodiment of this disclosure;

FIG. 5L is another schematic diagram of displaying according to anembodiment of this disclosure;

FIG. 6A and FIG. 6B are another schematic diagram of displayingaccording to an embodiment of this disclosure;

FIG. 6C is another schematic diagram of displaying according to anembodiment of this disclosure;

FIG. 6D is another schematic diagram of displaying according to anembodiment of this disclosure;

FIG. 7A is a schematic diagram of signal exchange according to anembodiment of this disclosure;

FIG. 7B and FIG. 7C are another schematic diagram of signal exchangeaccording to an embodiment of this disclosure;

FIG. 7D is another schematic diagram of signal exchange according to anembodiment of this disclosure;

FIG. 8A is another schematic diagram of displaying according to anembodiment of this disclosure;

FIG. 8B and FIG. 8C are another schematic diagram of displayingaccording to an embodiment of this disclosure;

FIG. 8D, FIG. 8E, and FIG. 8F are another schematic diagram ofdisplaying according to an embodiment of this disclosure;

FIG. 8G is another schematic diagram of displaying according to anembodiment of this disclosure;

FIG. 8H is another schematic diagram of displaying according to anembodiment of this disclosure;

FIG. 9A is another schematic diagram of signal exchange according to anembodiment of this disclosure;

FIG. 9B is another schematic diagram of signal exchange according to anembodiment of this disclosure;

FIG. 9C and FIG. 9D are another schematic diagram of signal exchangeaccording to an embodiment of this disclosure;

FIG. 10A is another schematic diagram of displaying according to anembodiment of this disclosure;

FIG. 10B is another schematic diagram of displaying according to anembodiment of this disclosure;

FIG. 11 is another schematic diagram of signal exchange according to anembodiment of this disclosure;

FIG. 12A and FIG. 12B are another schematic diagram of displayingaccording to an embodiment of this disclosure;

FIG. 12C and FIG. 12D are another schematic diagram of displayingaccording to an embodiment of this disclosure;

FIG. 12E is another schematic diagram of displaying according to anembodiment of this disclosure;

FIG. 12F is another schematic diagram of displaying according to anembodiment of this disclosure;

FIG. 12G is another schematic diagram of displaying according to anembodiment of this disclosure;

FIG. 12H is another schematic diagram of displaying according to anembodiment of this disclosure;

FIG. 13 is another schematic diagram of signal exchange according to anembodiment of this disclosure;

FIG. 14A is another schematic diagram of displaying according to anembodiment of this disclosure;

FIG. 14B and FIG. 14C are another schematic diagram of displayingaccording to an embodiment of this disclosure;

FIG. 14D is another schematic diagram of displaying according to anembodiment of this disclosure;

FIG. 14E is another schematic diagram of displaying according to anembodiment of this disclosure;

FIG. 14F is another schematic diagram of displaying according to anembodiment of this disclosure;

FIG. 14G is another schematic diagram of displaying according to anembodiment of this disclosure;

FIG. 15 is another schematic diagram of signal exchange according to anembodiment of this disclosure;

FIG. 16A is another schematic diagram of displaying according to anembodiment of this disclosure;

FIG. 16B and FIG. 16C are another schematic diagram of displayingaccording to an embodiment of this disclosure;

FIG. 16D is another schematic diagram of displaying according to anembodiment of this disclosure;

FIG. 16E is another schematic diagram of displaying according to anembodiment of this disclosure;

FIG. 16F is another schematic diagram of displaying according to anembodiment of this disclosure;

FIG. 17A is another schematic diagram of signal exchange according to anembodiment of this disclosure;

FIG. 17B is another schematic diagram of displaying according to anembodiment of this disclosure;

FIG. 17C is another schematic diagram of displaying according to anembodiment of this disclosure;

FIG. 17D is another schematic diagram of displaying according to anembodiment of this disclosure;

FIG. 18A is another schematic diagram of displaying according to anembodiment of this disclosure;

FIG. 18B is another schematic diagram of displaying according to anembodiment of this disclosure;

FIG. 18C and FIG. 18D are another schematic diagram of displayingaccording to an embodiment of this disclosure;

FIG. 18E is another schematic diagram of displaying according to anembodiment of this disclosure;

FIG. 19A, FIG. 19B, and FIG. 19C are another schematic diagram of signalexchange according to an embodiment of this disclosure;

FIG. 20 is another schematic diagram of signal exchange according to anembodiment of this disclosure;

FIG. 21 is another schematic diagram of signal exchange according to anembodiment of this disclosure;

FIG. 22 is another schematic diagram of signal exchange according to anembodiment of this disclosure; and

FIG. 23 is a schematic diagram of a structure of a chip system accordingto an embodiment of this disclosure.

DESCRIPTION OF EMBODIMENTS

A system architecture in embodiments of this disclosure may include aplurality of electronic devices. Networking may be performed between theplurality of electronic devices, and the plurality of electronic devicesmay exchange information after the networking. Networking modes includebut are not limited to the following:

(1) WI-FI networking mode: The plurality of electronic devices mayaccess a same routing device (for example, a router). As shown in FIG. 1, a mobile phone 101, a mobile phone 102, a tablet computer 103, anotebook computer 104, and a smart television 105 may access a router106 to form a home network. Alternatively, the plurality of electronicdevices may join a same hotspot device (for example, access a hotspot ofa same mobile phone). In this case, the information exchanged betweenthe electronic devices may be forwarded by the hotspot device. Forexample, the mobile phone 102, the tablet computer 103, the notebookcomputer 104, and the smart television 105 may access the mobile phone101 to form a hotspot network, and the mobile phone 101 may serve as thehotspot device to forward information for each electronic device.

(2) BLUETOOTH networking mode: The plurality of electronic devices maybe connected to a same BLUETOOTH device (for example, the mobile phone102). In this case, the information exchanged between the electronicdevices may be forwarded by the BLUETOOTH device. As shown in FIG. 2 ,the mobile phone 101, the tablet computer 103, the notebook computer104, and the smart television 105 may access the mobile phone 102, toform a BLUETOOTH network, and the mobile phone 104 may serve as theBLUETOOTH device to forward information for each electronic device.

The plurality of electronic devices may use a plurality of networkingmodes, for example, use the WI-FI networking mode and the BLUETOOTHnetworking mode both. This is not limited in this disclosure.

As shown in FIG. 3 , in an embodiment of this disclosure, an electronicdevice 200 (for example, a mobile phone) is used as an example todescribe a structure of the electronic device provided in embodiments ofthis disclosure. The electronic device 200 (for example, the mobilephone) may include a processor 210, an external memory interface 220, aninternal memory 221, a Universal Serial Bus (USB) interface 230, acharging management module 240, a power management module 241, a battery242, an antenna 1, an antenna 2, a mobile communication module 250, awireless communication module 260, an audio module 270, a speaker 270A,a receiver 270B, a microphone 270C, a headset jack 270D, a sensor module280, a button 290, a motor 291, an indicator 292, a camera 293, adisplay screen 294, a subscriber identity module (SIM) card interface295, and the like.

The sensor module 280 may include a pressure sensor, a gyroscope sensor,a barometric pressure sensor, a magnetic sensor, an acceleration sensor,a range sensor, a proximity light sensor, a fingerprint sensor, atemperature sensor, a touch sensor, an ambient light sensor, a boneconduction sensor, and the like.

It may be understood that the structure illustrated in this embodimentdoes not constitute a specific limitation on the electronic device 200.In some other embodiments, the electronic device 200 may include more orfewer components than those shown in the figure, some components may becombined, some components may be split, or there may be differentcomponent arrangement. The components shown in the figure may beimplemented by hardware, software, or a combination of software andhardware.

The processor 210 may include one or more processing units. For example,the processor 210 may include an application processor (AP), a modemprocessor, a graphics processing unit (GPU), an image signal processor(ISP), a controller, a memory, a video codec, a digital signal processor(DSP), a baseband processor, and/or a neural-network processing unit(NPU). Different processing units may be independent components, or maybe integrated into one or more processors.

The controller may be a nerve center and a command center of theelectronic device 200. The controller may generate an operation controlsignal based on an instruction operation code and a time sequencesignal, to complete control of instruction reading and instructionexecution.

A memory may be further disposed in the processor 210, and is configuredto store instructions and data. In some embodiments, the memory in theprocessor 210 is a cache. The memory may store instructions or data justused or cyclically used by the processor 210. If the processor 210 needsto use the instructions or the data again, the processor 210 maydirectly invoke the instructions or the data from the memory. Thisavoids repeated access and reduces waiting time of the processor 210, sothat system efficiency is improved.

In some embodiments, the processor 210 may include one or moreinterfaces. The interfaces may include an Inter-Integrated Circuit (I2C)interface, an I2C Sound (I2S) interface, a pulse-code modulation (PCM)interface, a universal asynchronous receiver/transmitter (UART)interface, a mobile industry processor interface (MIPI), ageneral-purpose input/output (GPIO) interface, a SIM interface, a USBinterface, and/or the like.

It may be understood that an interface connection relationship betweenthe modules that is illustrated in this embodiment is merely an examplefor description, and constitutes no limitation on the structure of theelectronic device 200. In some other embodiments, the electronic device200 may alternatively use an interface connection manner different fromthat in the foregoing embodiment, or use a combination of a plurality ofinterface connection manners.

The charging management module 240 is configured to receive a charginginput from a charger. The charger may be a wireless charger or a wiredcharger. The charging management module 240 supplies power to theelectronic device by using the power management module 241 whilecharging the battery 242.

The power management module 241 is configured to connect to the battery242, the charging management module 240, and the processor 210. Thepower management module 241 receives an input of the battery 242 and/orthe charging management module 240, to supply power to the processor210, the internal memory 221, an external memory, the display screen294, the camera 293, the wireless communication module 260, and thelike. In some embodiments, the power management module 241 and thecharging management module 240 may alternatively be disposed in a samecomponent.

A wireless communication function of the electronic device 200 may beimplemented by using the antenna 1, the antenna 2, the mobilecommunication module 250, the wireless communication module 260, themodem processor, the baseband processor, and the like. In someembodiments, the antenna 1 and the mobile communication module 250 ofthe electronic device 200 are coupled, and the antenna 2 and thewireless communication module 260 of the electronic device 200 arecoupled, so that the electronic device 200 can communicate with anetwork and another device by using a wireless communication technology.

The antenna 1 and the antenna 2 are configured to transmit and receivean electromagnetic wave signal. Each antenna of the electronic device200 may be configured to cover one or more communication frequencybands. Different antennas may be further multiplexed, to improve antennautilization. For example, the antenna 1 may be multiplexed as adiversity antenna in a wireless local area network. In some otherembodiments, the antenna may be used in combination with a tuningswitch.

The mobile communication module 250 may provide a solution that is towireless communication such as second generation (2G)/third generation(3G)/fourth generation (4G)/fifth generation (5G) and that is applied tothe electronic device 200. The mobile communication module 250 mayinclude at least one filter, a switch, a power amplifier, a low-noiseamplifier (LNA), and the like. The mobile communication module 250 mayreceive an electromagnetic wave through the antenna 1, performprocessing such as filtering or amplification on the receivedelectromagnetic wave, and transmit a processed electromagnetic wave tothe modem processor for demodulation.

The mobile communication module 250 may further amplify a signalmodulated by the modem processor, and convert the signal into anelectromagnetic wave for radiation through the antenna 1. In someembodiments, at least a part of functional modules in the mobilecommunication module 250 may be disposed in the processor 210. In someembodiments, at least a part of functional modules in the mobilecommunication module 250 may be disposed in a same component as at leasta part of modules in the processor 210.

The wireless communication module 260 may provide a solution, applied tothe electronic device 200, to wireless communication including awireless local area network (WLAN) (for example, a WI-FI network),BLUETOOTH (BT), a global navigation satellite system (GNSS), frequencymodulation (FM), near-field communication (NFC), infrared (IR)technology, and the like.

The wireless communication module 260 may be one or more componentsintegrating at least one communication processing module. The wirelesscommunication module 260 receives an electromagnetic wave through theantenna 2, performs frequency modulation and filtering processing on anelectromagnetic wave signal, and sends a processed signal to theprocessor 210. The wireless communication module 260 may further receivea to-be-sent signal from the processor 210, perform frequency modulationand amplification on the signal, and convert the signal into anelectromagnetic wave for radiation through the antenna 2.

The electronic device 200 implements a display function by using theGPU, the display screen 294, the application processor, and the like.The GPU is a microprocessor for image processing, and is connected tothe display screen 294 and the application processor. The GPU isconfigured to perform mathematical and geometric computation, and renderan image. The processor 210 may include one or more GPUs that executeprogram instructions to generate or change display information.

The display screen 294 is configured to display an image, a video, andthe like. The display screen 294 includes a display panel.

The electronic device 200 may implement a photographing function byusing the ISP, the camera 293, the video codec, the GPU, the displayscreen 294, the application processor, and the like. The ISP isconfigured to process data fed back by the camera 293. The camera 293 isconfigured to capture a static image or a video. In some embodiments,the electronic device 200 may include one or N cameras 293, where N is apositive integer greater than 1.

The external memory interface 220 may be configured to connect to anexternal storage card, for example, a micro Secure Digital (SD) card, toextend a storage capability of the electronic device 200. The externalstorage card communicates with the processor 210 through the externalmemory interface 220, to implement a data storage function. For example,files such as music and a video are stored in the external storage card.

The internal memory 221 may be configured to store computer-executableprogram code. The executable program code includes instructions. Theprocessor 210 runs the instructions stored in the internal memory 221,to perform various function applications and data processing of theelectronic device 200. For example, in this embodiment of thisdisclosure, the processor 210 may execute the instructions stored in theinternal memory 221, and the internal memory 221 may include a programstorage area and a data storage area.

The program storage area may store an operating system, an applicationprogram required by at least one function (for example, a voice playingfunction or an image playing function), and the like. The data storagearea may store data (such as audio data and a phone book) created whenthe electronic device 200 is used, and the like. In addition, theinternal memory 221 may include a high-speed random-access memory (RAM),and may further include a nonvolatile memory, for example, at least onemagnetic disk storage component, a flash memory component, or aUniversal Flash Storage (UFS).

The electronic device 200 may implement audio functions such as musicplaying and recording through the audio module 270, the speaker 270A,the receiver 270B, the microphone 270C, the headset jack 270D, theapplication processor, and the like.

The button 290 includes a power button, a volume button, and the like.The button 290 may be a mechanical button, or may be a touch button. Themotor 291 may generate a vibration prompt. The motor 291 may beconfigured to provide an incoming call vibration prompt and a touchvibration feedback. The indicator 292 may be an indicator light, and maybe configured to indicate a charging status and a battery level change,or may be configured to indicate a message, a missed call, anotification, and the like. The SIM card interface 295 is configured toconnect to a SIM card. The SIM card may be inserted into or extractedout of the SIM card interface 295 to contact with and separate from theelectronic device 200. The electronic device 200 may support one or NSIM card interfaces, where N is a positive integer greater than 1. TheSIM card interface 295 may support a nano-SIM card, a micro-SIM card, aSIM card, and the like.

As shown in FIG. 4 , a software structure of the electronic deviceprovided in embodiments of this disclosure is described by using anexample. The software architecture of the electronic device may includean application layer, an application framework layer, a hardwareabstraction layer (HAL), and a driver layer. In this embodiment of thisdisclosure, an example in which an operating system of the electronicdevice is a dual-framework operating system (namely, an ANDROID systemand HarmonyOS) is used for description. Alternatively, the electronicdevice may use the ANDROID system, HarmonyOS, an IOS system, or anotheroperating system. This is not limited in embodiments of this disclosure.

The application layer may include an ANDROID application and a HarmonyOSapplication. The ANDROID application may include a device manager (DM)kit and a distributed execution framework (DEF) kit. The kit (a service)may be a software development kit (SDK) for providing a basic servicefor (the application of) the application layer. The DM kit may include adevice discovery module, a trusted device maintenance module, a deviceauthentication module, a device filtering and sorting module, and thelike. The HarmonyOS application may include a DM kit and a HarmonyOSSDK. The SDK may be a set of related documents, instances, and toolsthat assist in developing a type of software.

The DM kit may include a device discovery module, a trusted devicemaintenance module, a device authentication module, and a devicefiltering and sorting module, and the like. Optionally, the applicationlayer may further include applications such as camera, gallery,calendar, call, map, navigation, WLAN, BLUETOOTH, music, video, andShort Message/Messaging Service (SMS) message. This is not limited inthis disclosure.

The application framework layer may include a DM, a DEF, a distributedscheduler manager service (DMS), a two-dimensional code identificationmodule (hivision), a HarmonyOS tag management module, a securitymanagement module, a communication module, and a device informationdatabase (device profile). Certainly, the framework layer 302 mayfurther include an activity manager, a window manager, a contentprovider, a resource manager, a notification manager, and the like. Thisis not limited in embodiments of this disclosure.

The DM module mainly provides device discovery, trusted devicemaintenance, and device authentication capabilities. Secure and trustedconnections are established between devices with a same account ordifferent accounts and between an ANDROID device and a HarmonyOS deviceby maintaining local device information, writing information into atwo-dimensional code, scanning a code for identification, establishing aphysical connection, and maintaining device group information.Optionally, the DM may include a device discovery module, a trusteddevice maintenance module, a device authentication module, and a devicesorting and filtering module. The device discovery module is configuredto perform processing such as sending a broadcast, discovering a device,encapsulating device information, and issuing a device list pop-up UI.The trusted device maintenance module is configured to performprocessing such as querying a trusted device list, writing trusteddevice information, maintaining the trusted device list, and monitoringgo-online and go-offline of a trusted device. The device authenticationmodule is configured to perform processing such as underlying channelmanagement, access control, PIN mechanism management, and groupmanagement. The device sorting and filtering module is configured toperform processing such as device filtering and device sorting.

The HarmonyOS tag management module is responsible for providingcapabilities of HarmonyOS tag application, parsing, and formatting,HarmonyOS tag service query, and service distribution.

The DEF is responsible for providing discovery, registration, query, andmigration of an atomic service, and is responsible for underlying datacommunication between devices and device discovery.

The two-dimensional code identification module provides HarmonyOS taggeneration and code scanning capabilities, to generate a HarmonyOStwo-dimensional code tag based on tag information provided by a tagservice and scan the HarmonyOS two-dimensional code tag to trigger thetag service to parse the tag information.

The security management module (HiChain) manages groups in a distributedscenario and performs device group authentication, where the groupsinclude a public group and an application-level private group, andprovides secure and trusted communication and connections betweendevices and between applications in the distributed scenario.

The communication module manages self-discovery and self-networking ofdevices with a same account in the distributed scenario via a soft bus,discovers a device with a different account through scanning, andprovides a channel for communication between different devices, toensure secure and stable data transmission.

The DMS mainly provides capabilities of completing cross-device servicebinding and calling a cross-device ANDROID interface definition language(AIDL) interface. An AIDL is a description language for defining acommunication interface between a server and a client.

The device information database is responsible for reading/writing,storing, and managing device information.

The HAL may include a microphone, a speaker, a WI-FI module, a BLUETOOTHmodule, a camera, a sensor, and the like.

The driver layer is a layer between hardware and software, and may alsobe referred to as a kernel layer. The kernel layer includes at least adisplay driver, a camera driver, an audio driver, and a sensor driver.

The foregoing software architecture may be deployed on a plurality ofelectronic devices (for example, the mobile phone 101, the mobile phone102, the tablet computer 103, the notebook computer 104, the smarttelevision 105, and the router 106 in FIG. 1 or FIG. 2 ) in a currentnetworking environment.

The following describes technical solutions in embodiments of thisdisclosure with reference to the accompanying drawings in embodiments ofthis disclosure. In descriptions of this disclosure, unless otherwisespecified, “at least one” means one or more, and “a plurality of” meanstwo or more. In addition, to clearly describe the technical solutions inembodiments of this disclosure, terms such as “first” and “second” areused in embodiments of this disclosure to distinguish between same itemsor similar items that provide basically same functions or purposes. Aperson skilled in the art may understand that the terms such as “first”and “second” do not limit a quantity or an execution sequence, and donot indicate a definite difference.

For clear and brief descriptions of the following embodiments, relatedconcepts or technologies are briefly described first.

Ability is an abstract of an ability of an application. One applicationmay include one or more abilities. HarmonyOS supports deployment of theapplication in abilities. Abilities are classified into two types: anfeature ability (FA) and an atom ability (AA).

AA is a program entity that is developed by a third party based on aHarmonyOS service and that implements a single function, is configuredto provide an ability of running a task in background, and has no UI.The AA features multi-end deployment and distributed execution. AAsdepend on a system service, but do not depend on each other.

The FA is configured to provide an ability (function) of interactingwith a user. One FA may include one group of related pages (which mayalso be considered as one group of UIs). Each page may be represented byone AbilitySlice instance. The FA is a program entity that may call theAA to implement a complex function, is developed based on a newinterface/data/logic separated structure, and may be independentlypackaged and released. The FA provides the following abilities:installation-free, independent running without relying on anapplication, cross-device UI migration, cross-device binary migration,and the like. The UI of the FA is partially similar to but actuallydifferent from that of an applet or a fast application. Differencestherebetween may include two points: First, the FA may be migratedacross devices (where for example, an FA of a mobile phone A may bemigrated to a mobile phone B, so that the mobile phone B can control theFA of the mobile phone A). Second, the FA may be cross-platform, wherefor example, the FA may run in both an ANDROID system and HarmonyOS, andthe applet or the fast application usually runs in the ANDROID systemcurrently.

The FA may be shared between different devices by using an FA sharingtechnology, to be specific, an FA of a device may be migrated to anotherdevice for presentation and operation. Authentication needs to beperformed before the FA sharing to ensure security and reliability ofthe FA sharing.

Embodiments of this disclosure provide a function migration method,including device-level authentication and application-levelauthentication. After the application-level authentication is performedbetween different devices, specific applications of the differentdevices can communicate with each other (in other words, theapplications can exchange service data, for example, migrate an FA). Forexample, after a first application of a device A and a first applicationof a device B are mutually authenticated, the first application of thedevice A and the first application of the device B may communicate witheach other, but another application (for example, a second application)of the device A and another application (for example, a secondapplication) of the device B do not communicate with each other. Afterthe device-level authentication, all applications of the differentdevices can communicate with each other.

For ease of understanding, the following uses a mobile phone A and amobile phone B as an example to describe a UI for the device-levelauthentication provided in embodiments of this disclosure.

As shown in FIG. 5A, a user may enter a smart collaboration interface501 through a setting application, and the smart collaboration interface501 may include a list named “My device”. “My device” includes a localdevice (namely, the mobile phone A), kiki's Mate pad, and kiki's Matebook pro. The local device, kiki's Mate pad, and kiki's Mate book promay be devices with a same account (for example, sharing one HUAWEIaccount). Alternatively, the local device, kiki's Mate pad, and kiki'sMate book pro may be devices that have different accounts but have beenauthenticated (where for an authentication process, refer to thefollowing related descriptions).

Optionally, the smart collaboration interface 501 may include a “Bindanother device” button 502. In embodiments of this disclosure, bindingmeans establishing a trust relationship between two devices, so that anyapplications of the two devices can communicate with each other, forexample, can migrate an FA to each other without authentication. Inresponse to an operation (for example, a tap operation) performed by theuser on the “Bind another device” button 502, as shown in FIG. 5B, themobile phone A may display a “OneHop for addition” button 503 and a“Scan for addition” button 504. It should be understood that locations,names, shapes, and the like of elements (for example, buttons, icons,and text) in UIs corresponding to FIG. 5A and FIG. 5B are not fixed, andmay be freely combined or designed according to a requirement. Forexample, the button 502 in FIG. 5A may be replaced with the button 503and the button 504 in FIG. 5B.

For example, in response to a tap operation performed by the user on the“OneHop for addition” button 503, as shown in FIG. 5C, the mobile phoneA may display a “OneHop for addition” interface 505, and the “OneHop foraddition” interface 505 may display a pop-up box 506. The pop-up box 506includes a prompt picture and prompt information. The prompt informationmay be, for example, “OneHop for addition. After NFC of the mobile phoneis enabled, touch the back side to an ontag of the device”. The user mayperform an operation based on the prompt information to add a new devicein a OneHop manner. For another example, in response to a tap operationperformed by the user on the “Scan for addition” button 504, as shown inFIG. the mobile phone A may display a “Scan for addition” interface 507.The “Scan for addition” interface 507 may include a prompt picture andprompt information. The prompt information may be, for example, “Scan atwo-dimensional code on a device or a package”. The user may perform anoperation based on the prompt information to add a new device in a Scanmanner.

If the mobile phone A does not support adding a new device in the OneHopmanner and the Scan manner, as shown in FIG. 5E, in response to anoperation of tapping the “Bind another device” button 502 by the user,as shown in FIG. 5F, the mobile phone A may display a pop-up box 508.The pop-up box 508 includes prompt information “Ensure that a device hasbeen turned on and is near the mobile phone”, and may further include adevice, for example, Room's television, HUAWEI P20, and Mate book X pro,detected by the mobile phone A through a short-distance communicationnetwork (for example, a WI-FI network or a BLUETOOTH network). Eachdevice corresponds to one “Bind” button. In response to an operationperformed by the user on a “Bind” button 509 corresponding to HUAWEIP20, as shown in FIG. 5G, prompt information 510 “Wait for confirmationfrom the peer end . . . ” may be displayed below an identifier of HUAWEIP20. The pop-up box 508 may further include a “Cancel” button 511. Inresponse to an operation of tapping the “Cancel” button 511 by the user,the mobile phone A may return to the interface shown in FIG.

If the peer device makes a confirmation (for example, a user of the peerdevice agrees to the binding), as shown in FIG. 5H, the mobile phone Amay display a “Bind a new device” interface 512, where the “Bind a newdevice” interface 512 may include prompt information “Scan atwo-dimensional code displayed by the peer device”. The user may performan operation based on the prompt information, to add the new device. Itshould be understood that a jump relationship between different UIs isnot limited in embodiments of this disclosure. For example, as shown inFIG. 5F, in response to the operation of tapping the “Bind” button 509by the user, as shown in FIG. 5H, the mobile phone may directly displaythe scanning interface 512.

If the peer device does not make a confirmation (where for example, thepeer device does not have a binding function, the binding times out, thepeer device is busy, or a user of the peer device does not agree to thebinding), as shown in FIG. 5I, the mobile phone A may display a pop-upbox 521 to notify the user that “Device authentication fails”. Inresponse to an operation of tapping a “Get” button 522 by the user, thepop-up box 521 may be removed. Alternatively, the pop-up box 521 may beremoved after a preset period of time (for example, 3 seconds (s)). Inanother possible design, as shown in FIG. 5J, the mobile phone A maydisplay a pop-up box 523, to notify the user that “The peer end is busy.Please initiate binding later”. In response to an operation of tapping a“Get” button 524 by the user, the pop-up box 523 may be removed.Alternatively, the pop-up box 523 may be removed after a preset periodof time (for example, 3 s). In still another possible design, as shownin FIG. 5K, the mobile phone A may display a pop-up box 525, to notifythe user that “The peer end refuses to trust the local device, and thebinding fails”. In response to an operation of tapping a “Get” button526 by the user, the pop-up box 525 may be removed. Alternatively, thepop-up box 525 may be removed after a preset period of time (forexample, 3 s). Alternatively, as shown in FIG. 5L, the mobile phone Amay display a pop-up box 527 in the interface 512, to notify the userthat “The peer end has closed the two-dimensional code, deviceauthentication cannot be completed, and the binding fails”. In responseto an operation of tapping a “Get” button 528 by the user, the pop-upbox 527 may be removed.

It is assumed that the peer device is the mobile phone B (which may be,for example, HUAWEI P20). If the mobile phone B receives a bindingrequest of the mobile phone A when displaying a desktop 530, as shown inFIG. 6A, the mobile phone B may display a pop-up box 531. The pop-up box531 may include prompt information 532 “HUAWEI Mate 30 requests to bebound to the local device. Is the device trusted?”, and may furtherinclude a “Distrust” button 533 and a “Trust” button 534. A countdown(for example, 14 s) may be further displayed in the “Distrust” button.If the user does not tap any button when the countdown ends, the pop-upbox 531 may be automatically removed. In response to an operation oftapping the “Trust” button 534 by the user, the mobile phone A mayperform an authentication process with the mobile phone B (refer torelated descriptions of step 718A to step 732 below), so that the mobilephone A can be bound to the mobile phone B.

If the mobile phone B receives, in a screen-off state or a screen-lockedstate, a binding request of the mobile phone A, as shown in FIG. 6B, themobile phone B may display a pop-up box 536 in a screen-locked interface535. The pop-up box 536 may notify the user that a smart collaborationapplication receives the device binding request at 7:30 a.m., where thedevice binding request may be further “HUAWEI Mate 30 (namely, themobile phone A) requests to be bound to the local device. Is the devicetrusted?”. In response to an operation (for example, entering a passwordor a fingerprint) performed by the user to enter a desktop from thescreen-locked state, as shown in FIG. 6A, the pop-up box 536 may bechanged to a form of the pop-up box 531, and the user may choose totrust or distrust HUAWEI Mate 30 (namely, the mobile phone A).

If the mobile phone B receives, in a video playing or game state, abinding request of the mobile phone A, as shown in (a) in FIG. 6C, themobile phone B may display a pop-up box 541 in a video interface or agame interface 540. The pop-up box 541 may notify the user that a smartcollaboration application receives the device binding request, where thedevice binding request may be further “HUAWEI Mate 30 requests to bebound to the local device. Is the device trusted?”. In response to anoperation of tapping a drop-down control 542 by the user, as shown in(b) in FIG. 6C, the pop-up box 541 may present more information, forexample, may display a “Distrust” button 543 and a “Trust” button 544. Acountdown (for example, 14 s) may be further displayed in the “Distrust”button 543. If the user does not tap any button when the countdown ends,the pop-up box 541 may be automatically removed. In response to anoperation of tapping the “Trust” button 544 by the user, the mobilephone A may perform an authentication process with the mobile phone B(refer to related descriptions of step 718A to step 732 below).

In a possible design, in response to the operation of tapping the“Trust” button by the user, as shown in FIG. 6D, the mobile phone B mayreturn to the desktop 530, and display a pop-up box 550. The pop-up box550 may include a two-dimensional code 551 generated by the mobile phoneB, and may further include prompt information 552 “Scan for binding.Allow HUAWEI Mate 30 to scan to be bound to the local device”. In thiscase, the user of the mobile phone A may scan, by using the mobile phoneA, the two-dimensional code displayed by the mobile phone B, so that themobile phone A is bound to the mobile phone B. The pop-up box 550 mayfurther include a “Cancel” button 553. In response to an operation oftapping the “Cancel” button 553 by the user, the pop-up box 550 may beremoved.

In some embodiments, if the mobile phone A and the mobile phone B log into a same account (for example, a HUAWEI account), the mobile phone Amay be directly bound to the mobile phone B (where for example, in FIG.5F, the “Bind” button corresponding to the mobile phone B (HUAWEI P20)is tapped on the mobile phone A) without waiting for confirmation fromthe mobile phone B (for example, without waiting for the confirmationfrom the peer end as in FIG. 5G, or without scanning, as in FIG. 5H, thetwo-dimensional code displayed by the peer end).

The following uses the mobile phone A and the mobile phone B as anexample to describe a specific implementation of a device-levelauthentication method provided in embodiments of this disclosure. Themobile phone A and the mobile phone B are devices with differentaccounts. As shown in FIG. 7A, the method includes the following steps.

701: A user triggers, on the mobile phone A, an operation of binding themobile phone B.

For example, the user may tap, on the mobile phone A, a “Bind” buttoncorresponding to the mobile phone B. For example, as shown in FIG. 5F,the mobile phone A performs step 702 in response to an operation oftapping, by the user on the mobile phone A, the “Bind” button 509corresponding to the mobile phone B (HUAWEI P20).

702: A setting application of the mobile phone A initiates a bindingrequest to a DM of the mobile phone A.

The setting application is an application named “Settings”. The settingapplication is for configuration of a basic function of the mobile phoneA, for example, network configuration, display and brightnessconfiguration, sound and vibration configuration, and applicationmanagement configuration.

Information carried in the binding request may include a name (forexample, HUAWEI MATE 30) of the mobile phone A.

703: Optionally, after receiving the binding request sent by the settingapplication, the DM of the mobile phone A requests information about anauthenticated device from a device information database of the mobilephone A.

The DM of the mobile phone A may read the information about theauthenticated device from the device information database. The deviceinformation database stores the information about the device that hasperformed authentication with the mobile phone A. The information aboutthe authenticated device may include a device name and a deviceidentifier (ID). The device ID may be, for example, an internationalmobile equipment identity (IMEI). For example, the information about thedevice that has performed authentication with the mobile phone A may beenumerated in Table 1.

TABLE 1 Device name Device ID (IMEI) kiki’s Mate pad 123456XXXXXXXkiki’s Mate book pro 654321XXXXXXX

704: Optionally, the device information database of the mobile phone Areturns the information about the authenticated device to the DM of themobile phone A.

In a possible design, after the mobile phone A and the mobile phone Bare mutually authenticated, the information about the authenticateddevice may include information about the mobile phone B.

It should be understood that when the mobile phone A and the mobilephone B perform device-level authentication, step 703 and step 704 areoptional. If step 703 and step 704 are performed, in other words, if theinformation about the authenticated device is obtained, the mobile phoneA may present the authenticated device to the user. The authenticateddevice may be in a bound state by default, or may be re-bound.

Step 703 and step 704 are a schematic implementation of obtaining theinformation about the authenticated device by the DM of the mobile phoneA. The DM of the mobile phone A may alternatively obtain the informationabout the authenticated device in another manner (for example, byreading the information about the authenticated device from presetstorage space). This is not limited in this disclosure.

705: The DM of the mobile phone A requests information about a nearbydevice from a communication module of the mobile phone A.

The device manager may call the communication module of the device A byusing a resident service to continuously send a broadcast tosurroundings. In this way, the device manager may discover a totalquantity of near-field devices (namely, all devices in near-fieldcommunication, where the near-field communication may include WI-FIcommunication, BLUETOOTH communication, and the like) by registering abroadcast monitoring service. Further with reference to the information,about the authenticated device, that is read from the device informationdatabase, the DM may display, in an icon form, the authenticated device(for example, kiki's Mate pad and kiki's Mate book pro shown in FIG. 5E)and an unauthenticated device (for example, Room's television, HUAWEIP20, and Mate book X pro shown in FIG. 5F) in the total quantity ofnear-field devices by category.

It should be noted that there is no necessary execution sequence betweenstep 703 and step 705. This is not limited in this embodiment.

706: The communication module of the mobile phone A returns theinformation about the nearby device to the DM of the mobile phone A.

707: The DM of the mobile phone A pops up a nearby device list.

As shown in FIG. 5F, the DM of the mobile phone A may call a pop-up boxcapability, to pop up the pop-up box 508 (namely, the nearby devicelist) on a display screen of the mobile phone A. The pop-up box 508includes nearby devices such as Room's television, HUAWEI P20, and Matebook X pro.

708: The user selects a device that needs to be bound.

For example, as shown in FIG. 5F, the user may select, from the nearbydevice list, the device that needs to be bound. For example, the usermay select HUAWEI P20 (namely, the mobile phone B).

709: The DM of the mobile phone A requests the communication module ofthe mobile phone A to create an underlying channel.

The underlying channel may be a BLUETOOTH channel, a WI-FI channel, orthe like. This is not limited in this disclosure.

710: The communication module of the mobile phone A exchangesinformation with a communication module of the mobile phone B to createthe underlying channel.

711: Optionally, the communication module of the mobile phone A sends acreation success notification to the DM of the mobile phone A.

To be specific, the communication module of the mobile phone A sends anunderlying channel creation success notification to the DM of the mobilephone A, where the underlying channel creation success notificationindicates that the underlying channel is successfully created betweenthe communication module of the mobile phone A and the communicationmodule of the mobile phone B.

It should be understood that when the mobile phone A and the mobilephone B perform device-level authentication, step 711 is optional. Ifstep 711 is performed, the DM of the mobile phone A may subsequentlylearn in time that the underlying channel is successfully created, sothat data can be subsequently transmitted through the underlyingchannel. Alternatively, creation success of the underlying channel maybe learned of in another manner. For example, if an underlying channelcreation failure notification is not received within a preset period oftime, it may be considered that the underlying channel is successfullycreated.

712: The DM of the mobile phone A sends an authentication requestmessage to the mobile phone B through the communication module of themobile phone A.

The authentication request message may include an identifier (forexample, a name or an ID) of the mobile phone A and identityauthentication information generated by the mobile phone A, and theidentity authentication information generated by the mobile phone A mayinclude a token generated by the mobile phone A. The name of the mobilephone A may be, for example, HUAWEI MATE30. The token may be, forexample, a random character string having several bits.

The token may be for identity authentication. In this embodiment of thisdisclosure, the mobile phone A may send the token to the mobile phone B.The token may be a device number/device media access controller (MAC)address of the mobile phone A, or may be another identifier fordetermining the mobile phone A. After receiving the token of the mobilephone A, the mobile phone B may add information about the token to atwo-dimensional code image subsequently generated by the mobile phone B,so that the two-dimensional code image can be used only by the mobilephone A.

As shown in FIG. 7B and FIG. 7C, the foregoing method further includesthe following steps.

713: Optionally, the communication module of the mobile phone B sends acreation success notification to a DM of the mobile phone B.

To be specific, the communication module of the mobile phone B sends anunderlying channel creation success notification to the DM of the mobilephone B, where the underlying channel creation success notificationindicates that the underlying channel is successfully created betweenthe communication module of the mobile phone B and the communicationmodule of the mobile phone A.

It should be understood that when the mobile phone A and the mobilephone B perform device-level authentication, step 713 is optional. Ifstep 713 is performed, the DM of the mobile phone B may subsequentlylearn in time that the underlying channel is successfully created, sothat the data can be subsequently transmitted through the underlyingchannel. Alternatively, the creation success of the underlying channelmay be learned of in another manner. For example, if an underlyingchannel creation failure notification is not received within a presetperiod of time, it may be considered that the underlying channel issuccessfully created.

It should be noted that there is no necessary execution sequence betweenstep 711 and step 713. This is not limited in this embodiment.

714: The communication module of the mobile phone A sends theauthentication request message to the communication module of the mobilephone B.

The communication module of the mobile phone A may send theauthentication request message to the communication module of the mobilephone B through the underlying channel.

715: The communication module of the mobile phone B forwards theauthentication request message to the DM of the mobile phone B.

It may be understood that step 712, step 714, and step 715 are fordescribing a process in which the mobile phone A sends theauthentication request message to the mobile phone B. The DM of themobile phone A and the DM of the mobile phone B need to communicate witheach other through the communication module of the mobile phone A andthe communication module of the mobile phone B respectively. Certainly,the DM of the mobile phone A and the DM of the mobile phone B mayalternatively communicate with each other through another module, or mayeach have a communication capability and can directly communicate witheach other. This is not limited in this disclosure.

716: Optionally, the DM of the mobile phone B notifies, by using apop-up window, a user whether to agree to the binding.

For example, as shown in FIG. 6A, the mobile phone A may pop up thepop-up box 531. The pop-up box 531 may include the prompt information532 “HUAWEI Mate 30 requests to be bound to the local device. Is thedevice trusted?”, and may further include the “Distrust” button 533 andthe “Trust” button 534.

717: Optionally, the mobile phone B receives an operation indicatingthat the user agrees to the binding.

For example, as shown in FIG. 6A, that the user taps the “Trust” button534 may indicate that the user agrees to the binding.

If the user agrees (for example, as shown in FIG. 6A, if the user tapsthe “Trust” button 534), the DM of the mobile phone B may return, to theDM of the mobile phone A through the communication module, informationindicating that the user agrees, and the mobile phone A may notify theuser to actively scan a two-dimensional code (the two-dimensional codeimage) displayed by a peer end (the mobile phone B).

In addition, if the user does not agree (for example, if the user tapsthe “Distrust” button 533), the DM of the mobile phone B may return, tothe DM of the mobile phone A through the communication module,information indicating that the user does not agree, the mobile phone Amay display the prompt information shown in FIG. 5K, and the bindingfails.

It should be understood that when the mobile phone A and the mobilephone B perform device-level authentication, step 716 and step 717 maybe optional. For example, if the mobile phone A and the mobile phone Blog in to a same account, or set a service, for example, a familiaritynumber service, the mobile phone B may directly perform step 718A and asubsequent necessary step without requesting the user whether to agreeto the binding.

Step 716 and step 717 are an implementation in which the mobile phone Bnotifies the user whether to agree to the binding. The mobile phone Bmay alternatively notify the user in another manner, for example, byusing a background system notification message. This is not limited inthis disclosure.

718A: The DM of the mobile phone B determines whether the mobile phone Bhas created a group related to the mobile phone A.

The DM of the mobile phone B may query, from HiChain of the mobile phoneB, whether the mobile phone B has created a public group related to themobile phone A. HiChain of the mobile phone B may store informationabout all groups created by the mobile phone B, where the groups includea public group and a private group. The public group may be a groupcreated at a granularity of a device. For example, if two devices belongto one public group, it indicates that the device-level authenticationhas been performed between the two devices, and all applications of thetwo devices can securely communicate with each other. The private groupis a group created at a granularity of a device and an application. Forexample, a first application of a first device may performapplication-level authentication with a second application of a seconddevice. After the application-level authentication, the firstapplication and the second application belong to one private group. Inthis case, the first application and the second application may securelycommunicate with each other (for example, may securely share data).Identifiers of the first application and the second application may bethe same or different. This is not limited in this disclosure. If sameapplications respectively corresponding to two devices belong to oneprivate group, it indicates that the application-level authenticationhas been performed between the two devices, and the specificapplications respectively corresponding to the two devices can securelycommunicate with each other. For example, the information about all thegroups created by the mobile phone B may be enumerated in Table 2.

TABLE 2 Public group Private group Group 1 (mobile phone B Group 3(application 1 of the mobile phone B and mobile phone C) and application2 of a mobile phone D) Group 2 (mobile phone B Group 4 (application 1 ofthe mobile phone B and mobile phone D) and application 3 of a mobilephone E)

Optionally, the group 1 and the group 2 in Table 2 may be combined intoa group, for example, a group 5 (the mobile phone B, the mobile phone C,and the mobile phone D), including three members. In this way, themobile phone A may search the group 5 for a device that has performeddevice-level authentication with the mobile phone A, without traversingthe public groups created between every two devices.

Optionally, the group 3 and the group 4 in Table 2 may be combined intoa group, for example, a group 6 (the application 1 of the mobile phoneB, the application 2 of the mobile phone D, and the application 3 of themobile phone E), including three members. In this way, the mobile phoneA may search the group 6 for an application of a device that hasperformed application-level authentication with the mobile phone A,without traversing the private groups created between every twoapplications.

718B: If the mobile phone B has not created the group related to themobile phone A, the DM of the mobile phone B requests a securitymanagement module of the mobile phone B to create a group.

The security management module of the mobile phone B creates a groupabout the mobile phone A, and a group name is device IDs of the mobilephone A and the mobile phone B. Further, an attribute of the groupbetween the mobile phone A and the mobile phone B may be set to public,in other words, all applications of the mobile phone A and the mobilephone B may communicate with each other.

718C: The security management module of the mobile phone B sends a groupcreation success notification to the DM of the mobile phone B.

It should be understood that step 718B and step 718C are a schematicmanner of creating the group. Another manner of creating the group isnot limited in this disclosure. For example, the DM of the mobile phoneB may directly create the group.

719: The DM of the mobile phone B requests a tag from a HarmonyOS tagmanagement module of the mobile phone B.

The HarmonyOS tag management module of the mobile phone B may generatethe tag, where the tag includes authentication verification informationand a session identifier of the mobile phone B, and the authenticationverification information may include the token received from the mobilephone A. Alternatively, it may be considered that the authenticationverification information includes the token received from the mobilephone A and the session identifier of the mobile phone B. The sessionidentifier of the mobile phone B includes device connection informationof the mobile phone B. For example, the session identifier of the mobilephone B includes a WI-FI address (for example, an Internet Protocol (IP)address and a port number) or a BLUETOOTH address of the mobile phone B.

The authentication verification information may further include a PINcorresponding to the group. The PIN may be, for example, a random numberhaving several digits, for example, a random number having six digits oreight digits. In this embodiment of this disclosure, the mobile phone Bmay send the PIN corresponding to the group to the mobile phone A. Whenneeding to join the group created by the mobile phone B, the mobilephone A may include the PIN corresponding to the group in a request. Themobile phone B determines that the PIN included by the mobile phone A iscorrect (in other words, is sent by the mobile phone B to the mobilephone A), considers that the mobile phone A is secure and trusted, andallows the mobile phone A to join the group created by the mobile phoneB.

720: The HarmonyOS tag management module of the mobile phone B requestsa two-dimensional code image (BitMap) of the authentication verificationinformation from a two-dimensional code identification module of themobile phone B.

The two-dimensional code identification module of the mobile phone B mayassemble the two-dimensional code image based on the authenticationverification information. It should be noted that an example in which anidentifier is the two-dimensional code image is used in the foregoingembodiment for description. The two-dimensional code image may bereplaced with another type of identifier, for example, a bar code or acharacter string. This is not limited in this disclosure.

721: The two-dimensional code identification module of the mobile phoneB returns the two-dimensional code image to the HarmonyOS tag managementmodule of the mobile phone B.

722: The HarmonyOS tag management module of the mobile phone B returnsthe two-dimensional code image to the DM of the mobile phone B.

723 a: Optionally, the DM of the mobile phone B sends thetwo-dimensional code image to the communication module of the mobilephone B.

In a possible design, the DM of the mobile phone B may send thetwo-dimensional code image of the mobile phone B to the mobile phone Athrough the communication module of the mobile phone B, so that themobile phone A performs internal scanning on the two-dimensional codeimage, in other words, step 723 b to step 725 may be performed afterstep 723 a. In another possible design, the mobile phone B may displaythe two-dimensional code image of the mobile phone B on a displayinterface (for example, the display interface shown in FIG. 6D) of themobile phone B, so that the mobile phone A directly scans thetwo-dimensional code image, and a two-dimensional code identificationmodule in the mobile phone A can directly obtain the two-dimensionalcode image generated by the mobile phone B, to skip step 723 b to step725. Both the foregoing two designs can implement technical effects ofthis solution. This is not limited in this disclosure.

723 b: Optionally, the communication module of the mobile phone B sendsthe two-dimensional code image to the communication module of the mobilephone A.

The DM of the mobile phone A may trigger the two-dimensional codeidentification module, to scan, through the two-dimensional codeidentification module, the two-dimensional code image generated by themobile phone B.

As shown in FIG. 7D, the foregoing method further includes the followingsteps.

724: Optionally, the communication module of the mobile phone A sendsthe two-dimensional code image to the DM of the mobile phone A.

725: Optionally, the DM of the mobile phone A sends the two-dimensionalcode image to the two-dimensional code identification module of themobile phone A.

726: The two-dimensional code identification module of the mobile phoneA scans the two-dimensional code image, and sends identified informationto a HarmonyOS tag management module of the mobile phone A.

727: The HarmonyOS tag management module of the mobile phone A parsesthe information sent by the two-dimensional code identification module,to obtain a parsing result.

The parsing result may include information such as a token, a PIN, andthe session identifier of the mobile phone B.

728: The HarmonyOS tag management module of the mobile phone A sends theparsing result to the DM of the mobile phone A.

It may be understood that step 724 to step 728 are a schematicimplementation in which the mobile phone A processes the two-dimensionalcode image. The mobile phone A may alternatively process thetwo-dimensional code image in another manner. This is not limited inthis disclosure. For example, the DM of the mobile phone A may integratea two-dimensional code image processing function, so that the DM of themobile phone A can directly scan and parse the two-dimensional codeimage to obtain the information such as the token, the PIN, and thesession identifier of the mobile phone B.

729: The DM of the mobile phone A verifies the token.

If the token received from the mobile phone B is the same as the tokencarried in the authentication request message, step 730 is performed.

730: The DM of the mobile phone A succeeds in callback authentication.

It should be understood that when the mobile phone A and the mobilephone B perform device-level authentication, step 729 and step 730 areoptional. If step 729 and step 730 are performed, in other words, if theDM of the mobile phone A verifies the token, security of communicationbetween the mobile phone A and the mobile phone B can be better ensured.731: The mobile phone A joins the public group created by the mobilephone B.

The DM of the mobile phone A determines the WI-FI address or theBLUETOOTH address of the mobile phone B based on the session identifier,and applies to a security module of the mobile phone A for joining thegroup created by the mobile phone B.

The security module of the mobile phone A creates an underlyingcommunication channel by using the WI-FI address or the BLUETOOTHaddress, and sends a group join request to the mobile phone B, where thegroup join request may include a group ID. Optionally, the group joinrequest may further include a PIN. The mobile phone B receives the groupjoin request, and may verify the PIN. After authentication succeeds (tobe specific, the PIN is the same as the PIN in the two-dimensional codeimage), the two devices join the same group (where group members in thegroup may include the mobile phone A and the mobile phone B, and theattribute of the group is being public), to complete the authentication.

In a possible implementation, after the mobile phone B receives thegroup join request and the authentication succeeds, the mobile phone Bsends a response message to the mobile phone A, where the responsemessage indicates that the mobile phone A has joined the public groupcreated by the mobile phone B.

732: The security management module of the mobile phone A notifies theapplication (the setting application) that the authentication succeeds.

The mobile phone A may locally store information about the group. Theinformation about the group may include the group members (where thegroup members in the group may include the mobile phone A and the mobilephone B), and may further include the group name and attributeinformation (where for example, the attribute is being public) of thegroup.

In this way, the device-level authentication between the mobile phone Aand the mobile phone B is completed, and all the applications of themobile phone A and the mobile phone B can communicate with each other.For example, a live streaming application, a karaoke application, ashopping application, and a mailbox application of the mobile phone Amay communicate with a live streaming application, a karaokeapplication, a shopping application, and a mailbox application of themobile phone B.

In some embodiments, if one of the mobile phone A and the mobile phone Blogs in to an account (for example, a HUAWEI account), and the other onedoes not log in to the account, the mobile phone A and the mobile phoneB may perform all or a part of step 701 to step 732. In this way,verification (namely, the device-level authentication) is performed whenthe mobile phone A is bound to the mobile phone B, to ensure security ofdata between the devices.

In some embodiments, if neither of the mobile phone A and the mobilephone B logs in to an account (for example, a HUAWEI account), themobile phone A and the mobile phone B may perform step 701 to step 732.In this way, verification is performed when the mobile phone A is boundto the mobile phone B, to ensure security of data between the devices.

In some embodiments, if the mobile phone A and the mobile phone B log into a same account (for example, a HUAWEI account), the mobile phone Aand the mobile phone B may perform step 701 to step 732. In this way,verification is performed when the mobile phone A is bound to the mobilephone B, to further ensure security of data between the devices.

It should be noted that a part of step 701 to step 732 may be optional,in other words, are not necessarily technical features of thedevice-level authentication solution. For example, step 703 and step 704may be optional steps, in other words, the authenticated device may notbe queried, and the nearby device is directly viewed. For anotherexample, step 711 and step 713 may be optional steps, in other words,the creation success notification may not be sent. For another example,step 716 and step 717 may be optional steps, in other words, the bindingmay be directly performed without confirmation of the user. For anotherexample, step 723 b to step 725 may be optional steps. In this case, themobile phone A may directly obtain the two-dimensional code imagegenerated by the mobile phone B (for example, by scanning thetwo-dimensional code image displayed by the mobile phone B).

If the device-level authentication is not performed between the devices,the application-level authentication may be performed betweenapplications of the devices, so that the specific applications cancommunicate with each other. With reference to a specific scenario, thefollowing describes, by using a live streaming application as anexample, a UI for the application-level authentication provided inembodiments of this disclosure.

With development of e-commerce, more people pay attention to a new saleschannel, namely, live commerce. The live commerce requires not onlyclear photographing and accurate sound pick-up of a commerce device butalso better interaction experience. One disadvantage of the livecommerce is that a live streamer and clear commodity details cannot besimultaneously displayed in one camera shot. As a result, reality andrecognition presented by an e-commerce show guide are reduced.

For a live streaming service, this disclosure provides a distributedpresentation solution that is based on cross-device FA sharing. Forexample, a live streaming image of a mobile phone A (where the livestreaming image of the device A may be considered as an FA, for example,FA1) may be shared to a mobile phone B, and the mobile phone B maysimultaneously display the FA of the mobile phone A and a live streamingimage of the mobile phone B (where the live streaming image of thedevice B may be considered as an FA, for example, FA2), to display oneor more FAs across devices, omit complex switching of terminals by auser, and greatly reduce user operations. This disclosure does notrequire that the devices meet a requirement for using a same system orlog in to a same device account (for example, a same Huawei account).Therefore, this disclosure is widely applicable.

For example, as shown in FIG. 8A, after a user opens a live streamingapplication on a mobile phone A, the mobile phone A may display a livestreaming interface 801. The live streaming interface 801 may include a“Migrate” button 802, and the “Migrate” button 802 is in an upper rightcorner of the interface 801. It should be understood that the “Migrate”button 802 may alternatively be located at a position, for example, alower left corner, a lower right corner, or an upper right corner, ofthe interface 801. This is not limited in this disclosure. Certainly,text displayed on the button 802 may alternatively be other content, forexample, “Share” or “Transfer”. This is not limited in this disclosure.In response to an operation of tapping the “Migrate” button 802 (wherethe “Migrate” button 802 is for migrating (sending) the live streaminginterface of the mobile phone A to another device (for example, a mobilephone B)) by the user in the live streaming interface 801, as shown inFIG. 8B, the mobile phone A may pop up a pop-up box 803. It should beunderstood that a manner of jumping between UIs is not limited inembodiments of this disclosure. For example, as shown in FIG. 8A, inresponse to an operation performed by the user with a specific gesture(for example, three-finger sliding or knuckle tapping), as shown in FIG.8B, the mobile phone may display the pop-up box 803. The pop-up box 803may include nearby devices, and the nearby devices include authenticateddevices (Bedroom's television, monica's Mate pad, and the like) andunauthenticated devices (Living room's television, HUAWEI P20, Mate bookX pro, and the like). In response to an operation of tapping, by theuser, a control 804 corresponding to HUAWEI P20 (an unauthenticateddevice), the mobile phone A may send an authentication request messageto the mobile phone B. In addition, as shown in FIG. 8C, promptinformation 805 “Wait for confirmation from the peer end” may bedisplayed below HUAWEI P20. As shown in FIG. 8D, if the mobile phone B(HUAWEI P20) receives, when displaying a live streaming interface 811,the authentication request message sent by the mobile phone A, themobile phone B may display a pop-up box 812, where the pop-up box 812includes prompt information “HUAWEI Mate 30 (the mobile phone A)requests to migrate the live streaming interface to the local device.Agree or not?”. In response to an operation of tapping a drop-downbutton 813 by a user, as shown in FIG. 8E, the pop-up box 812 maydisplay more content, for example, a “Disagree” button 814 and an“Agree” button 815 a. Optionally, in response to an operation of tappingthe “Agree” button 815 a by the user, as shown in FIG. 8F, the mobilephone may display a pop-up box 815 b. The pop-up box 815 b may includean “Agree this time only” button 815 c and an “Always agree” (no promptis given later) button 815 d. In response to an operation of tapping the“Agree” button 815 a, the “Agree this time only” button 815 c, or the“Always agree” button 815 d by the user, as shown in FIG. 8G, the mobilephone B may display a pop-up box 816. The pop-up box 816 may include atwo-dimensional code image generated by the mobile phone B, and mayfurther include prompt information 817 “Scan for authentication. AllowHUAWEI Mate 30 to scan for authentication”. In this case, the user ofthe mobile phone A may scan the two-dimensional code image presented bythe mobile phone B, and then the mobile phone B may receive the livestreaming image (FA1) from the mobile phone A. As shown in FIG. 8H, themobile phone B may display, in the live streaming interface 811, a livestreaming interface 819 sent by the mobile phone A. Alternatively, inresponse to an operation of tapping the “Agree” button 815 by the user,the mobile phone B may receive the live streaming image (FA1) from themobile phone A. As shown in FIG. 8H, the mobile phone B may display, inthe live streaming interface 811, a live streaming interface 819 sent bythe mobile phone A.

The following uses the live streaming application as an example todescribe a specific implementation of the application-levelauthentication method provided in embodiments of this disclosure. Amethod provided in an embodiment of this disclosure may be applied totwo near-field devices, for example, a mobile phone A and a mobile phoneB. The mobile phone A and the mobile phone B are devices with differentaccounts (for example, do not log in to a same HUAWEI account), and alive streaming application is opened on both the mobile phone A and themobile phone B. As shown in FIG. 9A, the method includes the followingsteps.

901: The mobile phone A receives an operation of triggering functionmigration by a user.

For example, as shown in FIG. 8A, the user may tap the “Migrate” button802 when the mobile phone A is displaying a live stream of a livestreamer. The “Migrate” button may also be referred to as a “Share”button, a “Send” button, or the like. This is not limited in thisdisclosure.

The user may trigger the function migration in another manner. Forexample, the user may trigger the function migration in a OneHop manneror a Scan manner. This is not limited in this disclosure.

902: An application (for example, the live streaming application)initiates a migration request to a DM of the mobile phone A.

Information carried in the migration request may include aninitiating-end application identifier (a local live streamingapplication package name), a continuing-end application identifier (apeer live streaming application package name), and a name of the mobilephone A. The continuing-end package name may be provided by theapplication (for example, the live streaming application), and dependson a design made by an application vendor to the application. Detailsare not described herein.

In a possible design, the information carried in the migration requestmay be arranged in a preset sequence. For example, the preset sequencemay be successively the name of the mobile phone A, the initiating-endapplication identifier, and the continuing-end application identifier.Alternatively, the preset sequence may be successively theinitiating-end application identifier, the continuing-end applicationidentifier, and the name of the mobile phone A.

903: Optionally, after receiving the migration request, the DM of themobile phone A requests an authenticated device from a deviceinformation database of the mobile phone A.

For a specific process, refer to related descriptions in step 703.Details are not described herein again.

904: Optionally, the device information database of the mobile phone Areturns information about the authenticated device to the DM of themobile phone A.

It should be understood that when the mobile phone A and the mobilephone B perform device-level authentication, step 903 and step 904 areoptional. If step 903 and step 904 are performed, in other words, if theinformation about the authenticated device is obtained, the mobile phoneA may present the authenticated device to the user.

Step 903 and step 904 are a schematic implementation of obtaining theinformation about the authenticated device by the DM of the mobile phoneA. The DM of the mobile phone A may alternatively obtain the informationabout the authenticated device in another manner (for example, byreading the information about the authenticated device from presetstorage space). This is not limited in this disclosure.

905: The DM of the mobile phone A requests information about a nearbydevice from a communication module of the mobile phone A.

For a specific process, refer to related descriptions in step 705.Details are not described herein again.

906: The communication module of the mobile phone A returns theinformation about the nearby device to the DM of the mobile phone A.

907: The DM of the mobile phone A pops up a nearby device list.

The nearby device list may be, for example, the pop-up box 803 shown inFIG. 8B.

The user may select a device from the nearby device list. If anuntrusted device (namely, an unauthenticated device with a differentaccount (for example, a device that does not log in to a same Huaweiaccount)) is selected, step 908 to step 936 may be performed after step907 to perform application-level authentication. If a trusted device(for example, a device that logs in to a same Huawei account, or apreviously authenticated device (where the authentication includes thedevice-level authentication or the application-level authentication)) isselected, an FA may be directly migrated, in other words, step 933 tostep 936 may be directly performed after step 907.

908: The user selects the unauthenticated device.

For example, as shown in FIG. 8B, the user selects HUAWEI P20, andHUAWEI P20 is an untrusted device.

909: The DM of the mobile phone A requests the communication module ofthe mobile phone A to create an underlying channel.

The underlying channel may be a BLUETOOTH channel, a WI-FI channel, orthe like. This is not limited in this disclosure.

910: The communication module of the mobile phone A exchangesinformation with a communication module of the mobile phone B to createthe underlying channel.

911: Optionally, the communication module of the mobile phone A sends anunderlying channel creation success notification to the DM of the mobilephone A.

It should be understood that when the mobile phone A and the mobilephone B perform device-level authentication, step 911 is optional. Ifstep 911 is performed, the DM of the mobile phone A may subsequentlylearn in time that the underlying channel is successfully created, sothat data can be subsequently transmitted through the underlyingchannel. Alternatively, creation success of the underlying channel maybe learned of in another manner. For example, if an underlying channelcreation failure notification is not received within a preset period oftime, it may be considered that the underlying channel is successfullycreated.

912: The DM of the mobile phone A sends an authentication requestmessage to the mobile phone B through the communication module of themobile phone A.

The authentication request message includes an initiating-end devicename (for example, HUAWEI MATE30), an initiating-end package name (forexample, com.zhibo.video), and a continuing-end package name (forexample, com.zhibo.video). The authentication request message furtherincludes a token generated by the mobile phone A.

As shown in FIG. 9B, the foregoing method further includes the followingsteps.

913: Optionally, the communication module of the mobile phone B sends anunderlying channel creation success notification to a DM of the mobilephone B.

It should be noted that there is no necessary execution sequence betweenstep 911 and step 913. This is not limited in this embodiment.

It should be understood that when the mobile phone A and the mobilephone B perform device-level authentication, step 913 is optional. Ifstep 913 is performed, the DM of the mobile phone B may subsequentlylearn in time that the underlying channel is successfully created, sothat the data can be subsequently transmitted through the underlyingchannel. Alternatively, the creation success of the underlying channelmay be learned of in another manner. For example, if an underlyingchannel creation failure notification is not received within a presetperiod of time, it may be considered that the underlying channel issuccessfully created.

914: The communication module of the mobile phone A sends theauthentication request message to the communication module of the mobilephone B.

Information carried in the authentication request message may includethe initiating-end application identifier, the continuing-endapplication identifier, and the name of the mobile phone A.

In a possible design, the information carried in the authenticationrequest message may be arranged in a preset sequence. For example, thepreset sequence may be successively the name of the mobile phone A, theinitiating-end application identifier, and the continuing-endapplication identifier. Alternatively, the preset sequence may besuccessively the initiating-end application identifier, thecontinuing-end application identifier, and the name of the mobile phoneA.

915: The communication module of the mobile phone B forwards theauthentication request message to the DM of the mobile phone B.

It may be understood that step 912, step 914, and step 915 are fordescribing a process in which the mobile phone A sends theauthentication request message to the mobile phone B. The DM of themobile phone A and the DM of the mobile phone B need to communicate witheach other through the communication module of the mobile phone A andthe communication module of the mobile phone B respectively. Certainly,the DM of the mobile phone A and the DM of the mobile phone B mayalternatively communicate with each other through another module, or mayeach have a communication capability and can directly communicate witheach other. This is not limited in this disclosure.

916: Optionally, the DM of the mobile phone B notifies, by using apop-up window, a user whether to agree to the migration.

For example, as shown in FIG. 8D, if the mobile phone B receives, whendisplaying the live streaming interface 811, the authentication requestmessage sent by the mobile phone A, the mobile phone B may display thepop-up box 812, where the pop-up box 812 includes the prompt information“HUAWEI Mate 30 requests to migrate the live streaming interface to thelocal device. Agree or not?”. In response to an operation of tapping thedrop-down button 813 by the user, as shown in FIG. 8E, the pop-up box812 may display more content, for example, the “Disagree” button 814 andthe “Agree” button 815 a.

Optionally, in response to an operation of tapping the “Agree” button815 a by the user, as shown in FIG. 8F, the mobile phone may display thepop-up box 815 b. The pop-up box 815 b may include the “Agree this timeonly” button 815 c and the “Always agree” (no prompt is given later)button 815 d. It should be understood that, in response to an operationof tapping the “Agree this time only” button 815 c by the user, afterthe following step 917 to step 932 are performed, the mobile phone A maymigrate a live streaming interface (namely, FA1) to the mobile phone Bonce. When the FA is migrated from the live streaming application of themobile phone A to the live streaming application of the mobile phone Bnext time, authentication, for example, step 901 to step 932, needs tobe performed again. In response to an operation of tapping the “Alwaysagree” button 815 d by the user, after the following step 917 to step932 are performed, the FA may be always migrated from the live streamingapplication of the mobile phone A to the live streaming application ofthe mobile phone B, and authentication does not need to be performedagain (where for example, step 901 to step 932 do not need to beperformed again).

917: Optionally, the mobile phone B receives an operation indicatingthat the user agrees to the migration.

For example, as shown in FIG. 8E, the mobile phone B may receive anoperation of tapping the “Agree” button 815 a by the user.

If the user agrees (for example, if the user taps the “Agree” button 815a), the DM of the mobile phone B may return, to the DM of the mobilephone A through the communication module, information indicating thatthe user agrees, and the mobile phone A may notify the user to activelyscan a two-dimensional code (a two-dimensional code image) displayed bya peer end (the mobile phone B).

In addition, if the user does not agree (for example, if the user tapsthe “Disagree” button 814), the DM of the mobile phone B may return, tothe DM of the mobile phone A through the communication module,information indicating that the user does not agree, the mobile phone Amay display the prompt information shown in FIG. 5K, and the migrationfails.

It should be understood that when the mobile phone A and the mobilephone B perform device-level authentication, step 916 and step 917 maybe optional. For example, if the mobile phone A and the mobile phone Blog in to a same account, or set a service, for example, a familiaritynumber service, the mobile phone B may directly perform step 918A and asubsequent necessary step without requesting the user whether to agreeto the migration.

Step 916 and step 917 are an implementation in which the mobile phone Bnotifies the user whether to agree to the migration. The mobile phone Bmay alternatively notify the user in another manner, for example, byusing a background system notification message. This is not limited inthis disclosure.

918A: The DM of the mobile phone B determines whether the mobile phone Bhas created a group related to the live streaming application of themobile phone A.

The DM of the mobile phone B may query, from HiChain of the mobile phoneB, whether the mobile phone B has created a private group related to themobile phone A. For related descriptions, refer to step 718A. Detailsare not described herein again.

918B: If the mobile phone B has not created the group related to thelive streaming application of the mobile phone A, the DM of the mobilephone B requests a security management module of the mobile phone B tocreate a group.

The security module of the mobile phone B may create a group about thelive streaming application of the mobile phone A (where group members inthe group may include the live streaming application of the mobile phoneA and the live streaming application of the mobile phone B). Further, anattribute of the group may be set to private, to be specific, the groupis applicable only to the specific application (the live streamingapplication).

Optionally, the mobile phone B may send, to the mobile phone A, a groupID of the group that is about the live streaming application of themobile phone A and that is created by the mobile phone B. The mobilephone A may join, based on the group ID, the group created by the mobilephone B. Optionally, the mobile phone B may further send a device ID ofthe mobile phone B to the mobile phone A. The device ID of the mobilephone B may be used when the mobile phone A communicates with the mobilephone B, and may include a network ID (netId) and a device IP address(deviceIP).

918C: The security management module of the mobile phone B sends a groupcreation success notification to the DM of the mobile phone B.

It should be understood that step 918B and step 918C are a schematicmanner of creating the group. Another manner of creating the group isnot limited in this disclosure. For example, the DM of the mobile phoneB may directly create the group.

919: The DM of the mobile phone B requests a tag from a HarmonyOS tagmanagement module of the mobile phone B.

The HarmonyOS tag management module of the mobile phone B may generatethe tag, where the tag includes authentication verification information,and the authentication verification information may include informationsuch as the token received from the mobile phone A and a sessionidentifier of the mobile phone B. The session identifier of the mobilephone B includes device connection information of the mobile phone B.For example, the session identifier of the mobile phone B includes aWI-FI address (for example, the IP address and a port number) or aBLUETOOTH address of the mobile phone B. The authentication verificationinformation may further include a PIN corresponding to the group.

920: The HarmonyOS tag management module of the mobile phone B requeststhe two-dimensional code image of the authentication verificationinformation from a two-dimensional code identification module of themobile phone B.

The two-dimensional code identification module of the mobile phone B mayassemble the two-dimensional code image based on the authenticationverification information.

921: The two-dimensional code identification module of the mobile phoneB returns the two-dimensional code image to the HarmonyOS tag managementmodule of the mobile phone B.

922: The HarmonyOS tag management module of the mobile phone B returnsthe two-dimensional code image to the DM of the mobile phone B.

923 a: Optionally, the DM of the mobile phone B sends thetwo-dimensional code image to the communication module of the mobilephone B.

In a possible design, the DM of the mobile phone B may send thetwo-dimensional code image of the mobile phone B to the mobile phone A,so that the mobile phone A performs internal scanning on thetwo-dimensional code image, in other words, step 923 b to step 925 maybe performed after step 923 a. In another possible design, the mobilephone B may display the two-dimensional code image of the mobile phone Bon a display interface (for example, the display interface shown in FIG.8G) of the mobile phone B, so that the mobile phone A directly scans thetwo-dimensional code image, and a two-dimensional code identificationmodule in the mobile phone A can directly obtain the two-dimensionalcode image generated by the mobile phone B, to skip step 923 b to step925. Both the foregoing two designs can implement technical effects ofthis solution. This is not limited in this disclosure.

923 b: Optionally, the communication module of the mobile phone B sendsthe two-dimensional code image to the communication module of the mobilephone A.

The DM of the mobile phone A may trigger the two-dimensional codeidentification module, to scan, through the two-dimensional codeidentification module, the two-dimensional code image generated by themobile phone B.

As shown in FIG. 9C and FIG. 9D, the foregoing method further includesthe following steps.

924: Optionally, the communication module of the mobile phone A sendsthe two-dimensional code image to the DM of the mobile phone A.

925: Optionally, the DM of the mobile phone A sends the two-dimensionalcode image to the two-dimensional code identification module of themobile phone A.

926: The two-dimensional code identification module of the mobile phoneA scans the two-dimensional code, and sends identified information tothe HarmonyOS tag management module of the mobile phone A.

927: The HarmonyOS tag management module of the mobile phone A parsesthe information sent by the two-dimensional code identification module,to obtain a parsing result.

The parsing result may include information such as a token of the mobilephone B, a PIN, and the session identifier of the mobile phone B.

928: The HarmonyOS tag management module of the mobile phone A sends theparsing result to the DM of the mobile phone A.

It may be understood that step 924 to step 928 are a schematicimplementation in which the mobile phone A processes the two-dimensionalcode image. The mobile phone A may alternatively process thetwo-dimensional code image in another manner. This is not limited inthis disclosure. For example, the DM of the mobile phone A may integratea two-dimensional code image processing function, so that the DM of themobile phone A can directly scan and parse the two-dimensional codeimage to obtain the information such as the token, the PIN, and thesession identifier of the mobile phone B.

929: The DM of the mobile phone A verifies the token.

If the token received from the mobile phone B is the same as the tokencarried in the authentication request message, step 930 is performed.

930: The DM of the mobile phone A succeeds in callback authentication.

It should be understood that when the mobile phone A and the mobilephone B perform device-level authentication, step 929 and step 930 areoptional. If step 929 and step 930 are performed, in other words, if theDM of the mobile phone A verifies the token, security of communicationbetween the mobile phone A and the mobile phone B can be better ensured.

931: The live streaming application of the mobile phone A joins theprivate group created by the mobile phone B.

The DM of the mobile phone A indexes, based on the session identifier,the WI-FI address or the BLUETOOTH address that is of the peer device(namely, the mobile phone B) and that is locally stored, and applies toa security module of the mobile phone A for joining the private groupcreated by the mobile phone B.

The security module of the mobile phone A creates an underlyingcommunication channel by using the WI-FI address or the BLUETOOTHaddress, and sends a group join request to the mobile phone B, where thegroup join request includes the PIN that is obtained through parsing andthe group ID. The mobile phone B receives the group join request, andverifies the PIN. After authentication succeeds (to be specific, the PINis the same as the PIN in the two-dimensional code image), the livestreaming applications of the two devices join the same group (where thegroup members in the group may include the live streaming application ofthe mobile phone A and the live streaming application of the mobilephone B, and the attribute of the group is being private), to completethe authentication.

In a possible implementation, after the mobile phone B receives thegroup join request and the authentication succeeds, the mobile phone Bsends a response message to the mobile phone A, where the responsemessage indicates that the live streaming application of the mobilephone A has joined the private group created by the mobile phone B.

932: The security management module of the mobile phone A notifies thelive streaming application that the authentication succeeds.

In this way, the application-level authentication between the livestreaming application of the mobile phone A and the live streamingapplication of the mobile phone B is completed, and the live streamingapplications of the mobile phone A and the mobile phone B cancommunicate with each other.

933: The live streaming application of the mobile phone A requests a DEFof the mobile phone A to migrate FA1.

FA1 may implement all or a part of functions in the live streamingapplication, and includes one or more UIs.

934: The DEF of the mobile phone A sends service information of FA1 to aDMS of the mobile phone B.

The service information of FA1 may include a video stream, an audiostream, bullet screen information, or the like of a live stream.

935: The DMS of the mobile phone B requests a DEF of the mobile phone Bto continue FA1.

That the DEF of the mobile phone B continues FA1 means that the mobilephone B processes FA1 based on the received service information anddisplays FA1. Display content of FA1 on the mobile phone B may besynchronized with display content of FA1 on the mobile phone A, or maybe different from the display content of FA1 on the mobile phone A interms of a format or a part of the content. This is not limited in thisdisclosure.

936: The DEF of the mobile phone B triggers and presents FA1.

That the DEF of the mobile phone B triggers FA1 means that the mobilephone B runs and displays FA1.

If the mobile phone B is currently displaying a live streaming image (inother words, running FA2), the DEF of the mobile phone B may detect FA2of the mobile phone B. If FA2 has an ability of displaying FA1 (in otherwords, FA2 supports displaying a plurality of FAs), the DEF may triggerand display live streaming FA1 on FA2, in other words, display aninterface of FA1 in an interface of FA2. For example, as shown in FIG.8H, the mobile phone B may display, in the live streaming interface 811,the live streaming interface 819 sent by the mobile phone A. In thisway, the user may simultaneously watch the live streaming image of themobile phone B and the live streaming image of the mobile phone A on themobile phone B, to present one or more FAs across devices, omit complexswitching of terminals by the user, and simplify user operations, sothat user experience can be improved.

If the mobile phone B is currently displaying a live streaming image (inother words, running FA2), but FA2 does not have an ability ofdisplaying FA1, FA1 fails to be migrated, but the mobile phone A maycontinue to share another FA (for example, a live shopping cart FA3) ofthe live streaming application without establishing a connection again.

If the mobile phone B is currently displaying a desktop interface, FA1of the mobile phone A may be previewed and controlled on the desktop.

It should be understood that, if there is a mobile phone C whose FA (forexample, FA4) is to be migrated to the mobile phone B, and the mobilephone B is currently in a display interface of FA2, and if FA2 has anability of displaying a plurality of FAs, the mobile phone B maysimultaneously display three FAs (FA1, FA2, and FA3). The rest can bededuced by analogy.

This embodiment of this disclosure is mainly applied to a scenario inwhich an FA is shared between live streaming applications acrossdevices, namely, a scenario in which a device can simultaneously displaya plurality of FAs through multi-device FA sharing. In this way,dual-view dual-image live streaming can be freely performed. This may beapplied to scenarios such as live streaming for review (an unboxingclose-up+a live streamer), sports guide (an athlete'sview+sportscaster), live streaming for education (a book close-up+ateacher), and live streaming for e-commerce (commodity details+a showguide), to improve user experience and product competitiveness.

In some embodiments, if one of the mobile phone A and the mobile phone Blogs in to an account (for example, a HUAWEI account), and the other onedoes not log in to the account, the mobile phone A and the mobile phoneB may perform step 901 to step 936. In this way, verification (namely,the device-level authentication) is performed when the FA migration isperformed between the mobile phone A and the mobile phone B, to ensuresecurity of data (for example, FA1) between the devices.

In some embodiments, if neither of the mobile phone A and the mobilephone B logs in to an account (for example, a HUAWEI account), themobile phone A and the mobile phone B may perform step 901 to step 936.In this way, verification is performed when the FA migration isperformed between the mobile phone A and the mobile phone B, to ensuresecurity of data between the devices.

In some embodiments, if the mobile phone A and the mobile phone B log into a same account (for example, a HUAWEI account), the mobile phone Aand the mobile phone B may perform step 901 to step 936. In this way,verification is performed when the FA migration is performed between themobile phone A and the mobile phone B, to further ensure security ofdata between the devices.

It should be noted that a part of step 901 to step 936 may be optional,in other words, are not necessarily technical features of theapplication-level authentication solution. For example, step 903 andstep 904 may be optional steps, in other words, the authenticated devicemay not be queried, and the nearby device is directly viewed. Foranother example, step 911 and step 913 may be optional steps, in otherwords, the creation success notification may not be sent. For anotherexample, step 916 and step 917 may be optional steps, in other words,the migration may be directly performed without confirmation of theuser. For another example, step 923 b to step 925 may be optional steps.In this case, the mobile phone A may directly obtain the two-dimensionalcode image generated by the mobile phone B (for example, by scanning thetwo-dimensional code image displayed by the mobile phone B).

With reference to a specific scenario, the following describes, by usinga photographing application as an example, a UI for theapplication-level authentication provided in embodiments of thisdisclosure.

During traveling, if a group of people need to take a team photo, apasserby or a peripheral, for example, a watch, is usually needed tocontrol a photographing button for photographing. However, it is usuallydifficult to take a satisfactory photo by relying on the passerby or theperipheral, for example, the watch, because a situation duringphotographing is not clear. This disclosure provides a method toestablish a connection between two devices based on a cross-device FAsharing technology, to use one device (for example, a mobile phone A) asa photographing mobile phone, and migrate a photographing FA of theremote device to another device (for example, a mobile phone B). In thisway, a user may hold the mobile phone B to observe a photographing imageof the mobile phone A and control the photographing. This helps the usertake a more satisfactory photo, and can improve user experience.

As shown in FIG. 10A, when a user uses a mobile phone A to take a photo,the mobile phone A displays a photographing interface 1001, and thephotographing interface includes a preview box and a menu area. Inresponse to an operation of tapping a “Migrate” button 1002 in the menuarea by the user A, the mobile phone A may send the photographinginterface (where the photographing interface of the mobile phone A maybe considered as an FA, for example, FA5) of the mobile phone A to amobile phone B. As shown in FIG. 10B, the mobile phone B may display andcontrol the photographing interface of the mobile phone A.

The following uses the photographing application as an example todescribe a specific implementation of the method provided in embodimentsof this disclosure. A method provided in an embodiment of thisdisclosure may be applied to two near-field devices, for example, amobile phone A and a mobile phone B. The mobile phone A and the mobilephone B are devices with different accounts. As shown in FIG. 11 , themethod includes the following steps.

1101: A user taps a “Migrate” button in a photographing application ofthe mobile phone A.

For example, as shown in FIG. 10A, the user A may tap the “Migrate”button 1002 in the photographing interface 1001.

1102: The photographing application of the mobile phone A initiates amigration request to a DM of the mobile phone A.

Information carried in the migration request includes an initiating-endpackage name (a local photographing application package name), acontinuing-end package name (a peer photographing application packagename), and a name of the mobile phone A.

For step 1103 to step 1132, refer to related descriptions of step 903 tostep 932. Details are not described herein again. A part of step 903 tostep 932 may be optional.

1133: The photographing application of the mobile phone A requests a DEFof the mobile phone A to migrate FA5.

1134: The DEF of the mobile phone A sends related information of FA5 toa DMS of the mobile phone B.

The related information of FA5 may include a photographing preview imageand menu bar information of a photographing interface.

1135: The DMS of the mobile phone B requests a DEF of the mobile phone Bto continue FA5.

That the DEF of the mobile phone B continues FA5 means that the mobilephone B processes FA5 based on received service information and displaysFA5.

1136: The DEF of the mobile phone B triggers and presents FA5.

As shown in FIG. 10B, the mobile phone B may display and control thephotographing interface (FA5) of the mobile phone A. In this embodimentof this disclosure, a connection is established between the two devicesby using a cross-device FA sharing technology, to share FA5 of themobile phone A with the mobile phone B, so that the photographinginterface can be previewed on the mobile phone B, and a photographingfunction of the mobile phone A can be controlled, thereby helping theuser take a more satisfactory photo, and improving user experience.

With reference to a specific scenario, the following describes, by usinga karaoke application as an example, a UI for the application-levelauthentication provided in embodiments of this disclosure.

With rapid development of the Internet, mobile karaoke is more popularamong users. For example, after a user opens the karaoke application toauthorize a login, the user may create a corresponding music room, andmay invite another user by sharing a music room link or an invitationcode to enter the music room. The other user may directly tap the linkor enter the invitation code to enter the same music room, and performoperations such as song pick-up or singing. However, the foregoingsharing process has many problems: (1) To share the music room createdat a local end to a friend face to face, a link needs to be forwardedvia WeChat®, QQ®, or the like. This needs many sharing steps. (2) Whenthe peer user receives the link of the music room and taps the link toenter the music room, if the karaoke application has not been installedon a peer device, the peer device needs to jump to an application marketto install the karaoke application. Then, the peer user taps the linkagain to enter the music room. This results in poor user experience. (3)The sharing of and entrance to the music room are strongly dependent onapplications such as WeChat®, QQ®, and the karaoke application on thedevice. Consequently, a device (for example, a television) with betternear-field experience cannot be used immediately.

For the karaoke scenario, this disclosure provides a multi-devicecollaborative control solution that is based on FA sharing, to supportcross-device application-level mutual assistance and sharing in a samenetwork (for example, a same WI-FI network). For example, a karaokeservice of a local device (for example, a mobile phone A) may beseamlessly transferred to another terminal device (for example, atelevision or a sound box). In addition, a user account does not need toauthorize a login, and a plurality of terminal devices are not requiredto use a same system. In this way, advantages of audio and video playingexperience of devices such as the television and the sound box andadvantages of convenient interaction and sound pick-up of devices suchas the mobile phone can be brought into full play, and operation stepsare simple and quick, thereby greatly improving user experience.

As shown in FIG. 12A, after a user opens a karaoke application on amobile phone A, the mobile phone A may display a karaoke interface 1201.In response to an operation of tapping, by the user, a “Sing” button1202 corresponding to a song “Hong Dou”, as shown in FIG. 12B, themobile phone A may display a karaoke interface 1203 of Hong Dou. Inresponse to an operation of tapping a “Migrate” button 1204 (where the“Migrate” button 1204 is for migrating (sending) the karaoke interfaceof the mobile phone A to another device (for example, a mobile phone B))by the user, as shown in FIG. 12C, the mobile phone may pop up a pop-upbox 1205. The pop-up box 1205 may include nearby devices, and the nearbydevices include authenticated devices (Bedroom's television, monica'sMate pad, and the like) and unauthenticated devices (Living room'stelevision, Brian's Mate pad, Mate book X pro, and the like). Inresponse to an operation of tapping, by the user, a control 1206corresponding to Room's television (an unauthenticated device), themobile phone A may send an authentication request message to the mobilephone B. In addition, as shown in FIG. 12D, prompt information 1207“Wait for confirmation from the peer end” may be displayed below Room'stelevision. As shown in FIG. 12E, the television may display a pop-upbox 1210. The pop-up box 1210 includes prompt information “HUAWEI Mate30 (the mobile phone A) requests to migrate a karaoke service to thelocal device. Agree or not?”, and may further include a “Disagree”button 1212 and an “Agree” button 1213. In response to an operation oftapping the “Agree” button 1213 by a user, as shown in FIG. 12F, thetelevision may display a pop-up box 1214. The pop-up box 1214 mayinclude a two-dimensional code image generated by the television, andmay further include prompt information 1215 “Scan for authentication.Allow HUAWEI Mate 30 to scan for authentication”. In this case, the userof the mobile phone A may scan the two-dimensional code image presentedby the television, and then the television may receive the karaokeinterface (where the karaoke interface may be considered as an FA, forexample, FA6) from the mobile phone A. As shown in FIG. 12G, thetelevision may display a karaoke interface 1217. Alternatively, inresponse to an operation of tapping the “Agree” button 815 by a user,the television may receive the karaoke interface (FA6) from the mobilephone A. As shown in FIG. 12G, the television may present a karaokeinterface 1217. Further, as shown in FIG. 12H, the mobile phone A mayre-orchestrate a UI as a song pick-up control station. Operations suchas song pick-up and song cut-off performed by the user on the mobilephone A and song list information are synchronously sent to thetelevision through a communication data channel, to control musicplaying on a television side.

The following uses the karaoke application as an example to describe aspecific implementation of the method provided in embodiments of thisdisclosure. A method provided in an embodiment of this disclosure may beapplied to two near-field devices, for example, a mobile phone A and atelevision, in a same network. The mobile phone A may use an ANDROIDsystem or a dual-framework system, the television may use HarmonyOS, andthe mobile phone A and the television are devices with differentaccounts. As shown in FIG. 13 , the method includes the following steps.

1301: A user taps a “Migrate” button in a karaoke application of themobile phone A.

1302: The karaoke application of the mobile phone A initiates amigration request to a DM of the mobile phone A.

Information carried in the migration request includes an initiating-endpackage name (a local karaoke application package name), acontinuing-end package name (a peer karaoke application package name),and a name of the mobile phone A.

For step 1303 to step 1332, refer to related descriptions of step 903 tostep 932. Details are not described herein again. A part of step 903 tostep 932 may be optional.

1333: The karaoke application of the mobile phone A requests a DEF ofthe mobile phone A to migrate FA6.

1334: The DEF of the mobile phone A sends related information of FA6 toa DMS of the television.

The related information of FA6 may include song information of karaoke,and the song information includes at least one of a song title (forexample, Hong Dou), lyrics, audio information, and video information.

1335: The DMS of the television requests a DEF of the television tocontinue FA6.

1336: The DEF of the television triggers and presents FA6.

If the karaoke application is installed on the television, the DEF ofthe television may detect whether the karaoke application and an accountof the television have been logged in to, and notify the user to log into the karaoke application, so that the karaoke application presents FA6sent by the mobile phone A.

If the karaoke application is not installed on the television, the DEFof the television may trigger FA6, in other words, provide an ability ofdisplaying FA6. A karaoke service can be used immediately withoutpre-installation of the karaoke application.

For the karaoke entertainment scenario, this embodiment of thisdisclosure provides a near-field application-layer data sharing service,to implement one-tap FA migration across devices and operating systemswithout relying on any third-party platform or requiring thepre-installation of the karaoke application. The karaoke service can beused immediately, and a mobile karaoke room can be quickly built,thereby improving user experience, simplifying operations, and improvingentertainment experience.

With reference to a specific scenario, the following describes, by usinga shopping application as an example, a UI for the application-levelauthentication provided in embodiments of this disclosure.

With rapid development of the Internet, especially popularization of themobile Internet, online shopping has become an indispensable element ofmost people's daily life. A mobile phone and a tablet computer are mostcommonly used terminal devices in online shopping. If the mobile phoneand the tablet computer can provide a user with better shoppingexperience, there is no doubt that market competitiveness of theterminal device can be greatly enhanced. Shopping on the mobile phone isused as an example. In various shopping festivals, merchants launch manydiscount activities. To pursue more affordable prices, users often askfriends and family members to purchase some commodities through groupbuying, to reach discount limits of the merchants. This process has thefollowing several disadvantages: (1) A commodity needs to be shared witha friend face to face through forwarding by WECHAT. This needs manysharing steps. (2) To participate in a discount activity, a userfrequently switches between a commodity selection and purchase page anda shopping cart. This results in complex operations. (3) When aplurality of people purchase a commodity of a merchant through groupbuying, operations such as sharing the commodity, adding the commodityto the shopping cart, and switching pages are more frequent. Afterpayment, a transfer operation is required. This is extremelyinconvenient. To resolve such problems, some vendors propose a solutionto face-to-face group buying. A commodity that a user wants to purchasethrough group buying may be shared with another user through codescanning via WeChat®, to implement a quick face-to-face group buyingoperation. However, this solution has some disadvantages. First, amerchant platform and an application scenario are greatly restricted.Second, a user A pays for a commodity and shares a two-dimensional codewith a user B, and the user B opens WECHAT to scan the two-dimensionalcode, and browses and purchases the commodity. This sharing processstill relies on the WECHAT platform, and includes many steps.

For the online shopping scenario, this disclosure provides anapplication-layer data sharing service that is based on near-field FAsharing, to support one-tap synchronization of shopping cart informationbetween a plurality of terminal devices in a same network (for example,a same WI-FI network). A shopping cart (where the shopping cart may beconsidered as an FA, for example, FA7) of a terminal device may bemigrated to another terminal device, accounts of commodities in shoppingcarts of the two devices may be settled together to enjoy a price-breakdiscount, and then payment is made separately to avoid mutual transfer.In this way, operation steps are simple and quick, and user experienceof group buying can be greatly improved. In addition, because anear-field FA sharing capability is a basic capability provided by asystem service, neither a same operating system nor login to a samedevice account (for example, a HUAWEI account) is needed, and even ashopping application does not need to be installed on the device.Therefore, the near-field FA sharing capability is highly universal andcan be applied to various e-commerce platforms, and adaptation costs arelow, so that more users can enjoy more convenient online shoppingexperience.

For example, as shown in FIG. 14A, after opening a shopping applicationon a mobile phone A, a user may enter a shopping cart interface 1401. Inresponse to an operation of tapping a “Migrate” button 1402 (where the“Migrate” button 1402 is for migrating (sending) a shopping cart of themobile phone A to another device (for example, a mobile phone B)) in theshopping cart interface 1401 by the user, as shown in FIG. 14B, themobile phone may pop up a pop-up box 1403. The pop-up box 1403 mayinclude nearby devices, and the nearby devices include authenticateddevices (Bedroom's television, monica's Mate pad, and the like) andunauthenticated devices (Living room's television, HUAWEI P20, Mate bookX pro, and the like). In response to an operation of tapping, by theuser, a control 1404 corresponding to HUAWEI P20 (an unauthenticateddevice), the mobile phone A may send an authentication request messageto the mobile phone B. In addition, as shown in FIG. 14C, promptinformation 1405 “Wait for confirmation from the peer end” may bedisplayed below HUAWEI P20. As shown in FIG. 14D, if the mobile phone B(HUAWEI P20) receives, when displaying a desktop, the authenticationrequest message sent by the mobile phone A, the mobile phone B maydisplay a pop-up box 1410, where the pop-up box 1410 includes promptinformation “HUAWEI Mate 30 (the mobile phone A) requests to migrate theshopping cart to the local device. Agree or not?”, and may include a“Disagree” button 1412 and an “Agree” button 1413. In response to anoperation of tapping the “Agree” button 1413 by a user, as shown in FIG.14E, the mobile phone B may display a pop-up box 1415. The pop-up box1415 may include a two-dimensional code image generated by the mobilephone B, and may further include prompt information 1416 “Scan forbinding. Allow HUAWEI Mate 30 to scan for authentication”. In this case,the user of the mobile phone A may scan the two-dimensional code imagedisplayed by the mobile phone B, and then the mobile phone B may receivethe shopping cart (FA6) from the mobile phone A. Alternatively, inresponse to an operation of tapping the “Agree” button 1413 by a user,the mobile phone B may receive the shopping cart (FA6) from the mobilephone A. As shown in FIG. 14F, the mobile phone B may display a sharedshopping cart in a shopping cart interface 1417, and the shared shoppingcart includes not only a commodity added by “me” but also a commodityadded by the user A (the user of the mobile phone A). In addition, themobile phone B may also migrate a shopping cart (for example, FA7) ofthe mobile phone B to the mobile phone A. In this way, as shown in FIG.14G, the mobile phone A may display a shared shopping cart in a shoppingcart interface 1407, and the shared shopping cart includes not only acommodity added by “me” but also a commodity added by the user B (theuser of the mobile phone B). In this way, the user can implement one-tapgroup buying without relying on sharing through any third-partyplatform. This eliminates complex steps of sharing commodities with eachother and transferring money to each other, thereby greatly improvingshopping experience.

The following uses the shopping application as an example to describe aspecific implementation of the method provided in embodiments of thisdisclosure. A method provided in an embodiment of this disclosure may beapplied to two near-field devices, for example, a mobile phone A and amobile phone B. The mobile phone A and the mobile phone B are deviceswith different accounts. As shown in FIG. 15 , the method includes thefollowing steps.

1501: A user taps a “Migrate” button in a shopping application of themobile phone A.

As shown in FIG. 14A, after opening the shopping application on themobile phone A, the user selects a commodity, adds the commodity to ashopping cart, and then enters a shopping cart interface 1401. The usermay tap the “Migrate” button 1402 in the shopping cart interface 1401.The “Migrate” button 1402 is for migrating (sending) the shopping cartof the mobile phone A to another device (for example, the mobile phoneB).

1502: The shopping application initiates a migration request (a sharingrequest) to a DM of the mobile phone A.

Information carried in the migration request includes an initiating-endpackage name (a local shopping application package name), acontinuing-end package name (a peer shopping application package name),and a name of the mobile phone A. For example, the initiating-endpackage name is com.huawei.vmall, and the continuing-end package name iscom.huawei.vmall.

For step 1503 to step 1532, refer to related descriptions of step 903 tostep 932. Details are not described herein again. A part of step 903 tostep 932 may be optional.

1533: The shopping application of the mobile phone A requests a DEF ofthe mobile phone A to migrate FA7.

1534: The DEF of the mobile phone A sends related information of FA7 toa DMS of the mobile phone B.

The related information of FA7 includes commodity information in theshopping cart, and the commodity information includes at least one ofinformation such as a commodity name, a commodity link, and a commodityprice.

1535: The DMS of the mobile phone B requests a DEF of the mobile phone Bto continue FA7.

1536: The DEF of the mobile phone B triggers and presents FA7.

The DEF of the mobile phone B triggers FA7. As shown in FIG. 14F, themobile phone B may display the shared shopping cart in the shopping cartinterface 1417, where the shared shopping cart includes not only onecommodity in the shopping cart of the mobile phone B but also threecommodities selected by the user A. In this case, the user B candirectly view all commodities purchased through group buying. Afterselecting a part or all of the commodities in the shopping cart, theuser may check whether an amount meets a requirement of a price-breakdiscount activity, to implement a quick group buying function.

In addition, commodity information in the shared shopping cart may beupdated in real time. For example, if a new commodity is added to ashopping cart of a device (for example, the mobile phone A) thatinitiates migration, a shared shopping cart of a destination device (forexample, the mobile phone B) may also be refreshed immediately.

Further, when the user B taps a “Settle” button, the mobile phone B mayinitiate a payment request to the user A and include payment-relatedinformation. The payment-related information may include a collectionplatform, a payment amount, and the like. The payment amount may be:Total amount of commodities purchased by each user—(Total amount ofcommodities purchased by each user/Total amount of the shared shoppingcart)×Discount value. After payment, the shared shopping cart iscleared, and one group buying process ends.

According to the method provided in this embodiment of this disclosure,a shopping cart (where the shopping cart may be considered as an FA, forexample, FA7) of a terminal device may be migrated to another terminaldevice, accounts of commodities in shopping carts of the two devices maybe settled together to enjoy a price-break discount, and then payment ismade separately to avoid mutual transfer. In this way, operation stepsare simple and quick, and user experience of the group shopping can begreatly improved.

In some other embodiments, in a home environment, one user has onemobile phone and one television, and is participating in an activity of100 off on orders over 400. In a conventional shopping scenario, whenselecting a commodity on the mobile phone, the user frequently switchesbetween a commodity details page and a shopping cart page to view ormodify content of a shopping cart. According to the method provided inthis embodiment of this disclosure, the user may migrate the shoppingcart to the television, browse and select the commodity on the mobilephone, and watch the content of the shopping cart on the television atany time. This avoids a complex operation of repeatedly switching pageson the mobile phone, and can improve user experience.

In some other embodiments, a user selects some commodities on two mobilephones (a mobile phone A and a mobile phone C) respectively and adds thecommodities to shopping carts, and may migrate the shopping carts ofboth the mobile phone A and the mobile phone C to a television B. Afterthe mobile phone A and the mobile phone C both complete authenticationwith the television B, group members on the mobile phone A may include(shopping application of A, shopping application of B), group members onthe mobile phone C may include (shopping application of C, shoppingapplication of B), and group members on the television B include(shopping application of A, shopping application of B, shoppingapplication of C), where the group of the television includes threemembers. In other words, application-level authentication is performedbetween the shopping application of the television and each of theshopping application of the mobile phone A and the shopping applicationof the mobile phone C. Subsequently, the shopping application of thetelevision may communicate with the shopping application of the mobilephone A and the shopping application of the mobile phone C separately.

It should be understood that a scenario in which a shopping cart FA ismigrated based on the near-field FA sharing capability is mainlyapplicable to a networking environment, for example, a home environmentand a working environment. For a scenario not supporting near-fieldnetworking (short-distance networking), this solution can also be usedas a reference. For example, sharing and real-time synchronization ofshopping cart content can be implemented through the Internet.Alternatively, an e-commerce platform may integrate a shopping cart inan Internet environment into a shopping application of the e-commerceplatform and share the shopping cart through a cloud service and anaccount of the e-commerce platform.

With reference to a specific scenario, the following describes, by usinga mailbox application as an example, a UI for the application-levelauthentication provided in embodiments of this disclosure.

A use scenario of office software such as a mailbox is changing. Inaddition to conventional office and home scenarios, a business trip/atransportation vehicle/waiting/an outdoor walk has become a use scenarioof office personnel. Some vendors have provided a mailbox client on eachmobile platform, so that a user can access the mailbox on variousdevices. However, the user cannot seamlessly switch between a mobileoffice state and a non-mobile office state, and operations cannot beperformed continuously, resulting in poor user experience. For example,when the user receives an e-mail notification on a smartwatch, and wantsto reply on a mobile phone or a pad, the user further needs to open themobile phone/pad, log in to the mailbox, find an e-mail, and then reply.Consequently, operations are complex, and user experience is poor. Ahandoff technology proposed by APPLE enables a user to switch from anAPPLE device (for example, a MAC, an IPHONE, an IPAD, or an APPLE WATCH)to another nearby APPLE device to continue working, without losing atask process. However, this requires that the devices participating inmailbox handoff log in to a same APPLE ID, be installed with a samemailbox client in advance, and log in to a mailbox account. In addition,the technology cannot select a push device. For example, if an e-mailneeds to be pushed to a television for presentation in a conferenceroom, handoff cannot be implemented because the two devices do not login to the same APPLE ID.

For a scenario in which a business person switches between the mobileoffice state and the non-mobile office state, this disclosure providesan application continuing service that is based on near-fieldcross-device FA migration, to support one-tap e-mail migration between aplurality of terminal devices. For example, a watch may trigger ane-mail view interface on a mobile phone side with one tap, to directlydisplay e-mail text on the mobile phone side. For another example, foran e-mail draft that is being edited on a mobile phone side, thisdisclosure also supports one-tap seamless transfer of the e-mail draftto another device (for example, another mobile phone, a PAD, or atelevision) for continuing, to provide ultimate multi-device e-mailcollaboration experience. Neither a same system nor login of the devicesto a same account is needed in this disclosure, and even the mailboxapplication does not need to be installed on the devices at both ends.Therefore, an application scope is wide.

For example, after a user receives and opens an e-mail on a mobile phoneA, as shown in FIG. 16A, the mobile phone A may display an e-mailinterface 1601 (where the e-mail interface 1601 may be considered as anFA, for example, FA8). In response to an operation of tapping a“Migrate” button 1602 (where the “Migrate” button is for migrating(sending) the e-mail interface of the mobile phone A to another device(for example, a television)) in the e-mail interface 1601 by the user,as shown in FIG. 16B, the mobile phone A may pop up a pop-up box 1603.The pop-up box 1603 may include nearby devices, and the nearby devicesinclude authenticated devices (monica's Mate pad and the like) andunauthenticated devices (Television, HUAWEI P20, Mate book X pro, andthe like). In response to an operation of tapping, by the user, acontrol 1604 corresponding to Television (an unauthenticated device),the mobile phone A may send an authentication request message to thetelevision. In addition, as shown in FIG. 16C, prompt information 1605“Wait for confirmation from the peer end” may be displayed belowTelevision. As shown in FIG. 16D, the television may display a pop-upbox 1610. The pop-up box 1610 includes prompt information “HUAWEI Mate30 (the mobile phone A) requests to migrate the e-mail to the localdevice. Agree or not?”, and may further include a “Disagree” button 1614and an “Agree” button 1615. In response to an operation of tapping the“Agree” button 1613 by a user, as shown in FIG. 16E, the television maydisplay a pop-up box 1614. The pop-up box 1614 may include atwo-dimensional code image generated by the television, and may furtherinclude prompt information 1615 “Scan for authentication. Allow HUAWEIMate 30 to scan for authentication”. In this case, the user of themobile phone A may scan the two-dimensional code image presented by thetelevision, and then the television may receive the e-mail interface(FA8) from the mobile phone A. As shown in FIG. 16F, the television maydisplay an e-mail interface 1616. Alternatively, in response to anoperation of tapping the “Agree” button 1613 by the user, the televisionmay receive the e-mail interface (FA8) from the mobile phone A. As shownin FIG. 16F, the television may display an e-mail interface 1616.

The following uses the mailbox application as an example to describe aspecific implementation of the method provided in embodiments of thisdisclosure. A method provided in an embodiment of this disclosure may beapplied to two near-field devices, for example, a mobile phone A and aPC. The mobile phone A may use an ANDROID system, the PC may useHarmonyOS, and the mobile phone A and the PC are devices with differentaccounts. As shown in FIG. 17A, the method includes the following steps.

1701: A user taps a “Migrate” button in a mailbox application of themobile phone A.

The user opens and edits an e-mail on the mobile phone, and taps the“Migrate” button in an editing interface.

1702: The mailbox application of the mobile phone A initiates amigration request to a DM of the mobile phone A.

Information carried in the migration request includes an initiating-endpackage name (a local mailbox application package name), acontinuing-end package name (a peer mailbox application package name),and a name of the mobile phone A.

For step 1703 to step 1732, refer to related descriptions of step 903 tostep 932. Details are not described herein again. A part of step 903 tostep 932 may be optional.

1733: The mailbox application of the mobile phone A requests a DEF ofthe mobile phone A to migrate FA8.

The mailbox application may include parameters of the local device and atarget device (for example, identifiers of the local device and thetarget device) to request the DEF of the mobile phone A to continue FA8.

1734: The DEF of the mobile phone A sends related information of FA8 toa DMS of the PC.

The related information of FA8 may include e-mail content information,where the e-mail content information may include information such as asubject, text, and an attachment.

1735: The DMS of the television requests a DEF of the television tocontinue a service.

1736: The DEF of the television triggers and presents FA8.

If a mailbox client is installed on the television, the DEF of thetelevision may detect whether the mailbox client and an account havebeen logged in to, and notify the user to log in to the mailbox account,so that the mailbox application can trigger and present FA8, to bespecific, display an e-mail interface migrated from the mobile phone A.

If a mailbox client is not installed on the television, the DEF of thetelevision may trigger and present FA8, to be specific, encode andrearrange FA8 for displaying. In this way, a device that does not log into/is not installed with the mailbox client can also present the e-mailcontent, and disclosure of privacy information such as the e-mailaccount can be avoided. In addition, if the DEF of the television doesnot support presenting FA8, an FA that can present FA8 may be downloadedfrom an application market and installed (where the FA may be developedby a third-party application vendor).

Further, the user may perform operations such as editing and replying onthe e-mail on the PC. The edited and replied e-mail content may be sentback to the mobile phone A through a data communication channel, and thee-mail is sent based on account information of the mobile phone A. Inthis way, one-tap migration can be implemented even if the mailboxclient is not installed on the television or the television does not login to the mailbox account, improving user experience and officeefficiency. A migration device may be used only for presentation andediting, and the e-mail is finally sent and received by a migrationinitiating end. The migration device can view only an e-mail activelypushed by the initiating end. After a process ends, content isproactively destroyed, ensuring that the e-mail is seamlessly migratedwith the user.

In this disclosure, the e-mail can be transferred between a plurality ofdevices, login to a same device account is not required, and it is notrequired that all devices be installed with the mailbox client and login to the mailbox account, so that a range of available devices isgreatly expanded.

In addition, if networking and authentication between two devices havebeen completed, a “Migrate” button can be directly tapped to completemigration. This is more convenient and quicker. For example, it isassumed that networking and authentication between a watch, a mobilephone, and a PC have been completed. As shown in FIG. 17B, afterreceiving an e-mail notification, the watch of a user may display ane-mail notification interface 1701, to notify the user that there is ane-mail. In response to an operation of tapping a “View” button 1702 bythe user, as shown in FIG. 17C, the watch may directly trigger an e-mailview interface 1704 on a mobile phone side (where the watch may send ane-mail view request to the mobile phone, and the mobile phone maydirectly display the e-mail view interface 1704), to directly displaye-mail text. In a process in which the user edits a reply e-mail on themobile phone, if a document needs to be inserted, but the document isstored in the PC, the user may tap a “Migrate” button 1705 on the mobilephone to migrate the e-mail to the PC. As shown in FIG. 17D, the PC maydisplay an e-mail editing interface 1706. After inserting an attachmentin the e-mail editing interface 1706, the user may tap a “Migrate”button 1707 to migrate the e-mail carrying the attachment to the mobilephone again. In this way, the watch, the mobile phone, and the PC cancollaborate to work conveniently and quickly, and user experience ishigh.

This disclosure implements one-tap migration and seamless transfer ofthe e-mail between mobile office and non-mobile office based on anear-field cross-device FA migration technology, to greatly improvemulti-device collaborative office experience. Multi-device e-mailmigration is not restricted by the user account/mailbox client/mailboxaccount, so that a plurality of types of devices in a same network canbe covered, thereby greatly expanding a use scenario of the e-mailmigration.

In the foregoing embodiment, a receiver (a passive migration device, forexample, the mobile phone B or the television) generates two-dimensionalcode information, and an initiator (an active migration device, forexample, the mobile phone A) parses the two-dimensional code informationof the mobile phone B to join the group created by the mobile phone B,to perform authentication.

In some other embodiments, the initiator (the active migration device,for example, the mobile phone A) may alternatively generatetwo-dimensional code information, and the receiver (the passivemigration device, for example, the mobile phone B or the television)performs authentication based on the two-dimensional code information ofthe mobile phone A.

For example, as shown in FIG. 18A, a user A may select a “Migrate”option 1801 (where the “Migrate” option 1801 is for migrating (sending)a karaoke interface of a television to another device (for example, amobile phone B)) in the karaoke interface 1800 of the television.Optionally, the user A may select the “Migrate” option through a controldevice (for example, a remote control or a mobile phone). Alternatively,if the television is a touch device, the user A may directly tap the“Migrate” option to select the “Migrate” option. As shown in FIG. 18B,the television may pop up a pop-up box 1802. The pop-up box 1802 mayinclude a two-dimensional code image generated by the television, andmay further include prompt information 1803 “Scan for authentication.Allow another device to scan to join my music room”. A user B may scan,by using a mobile phone B, the two-dimensional code image displayed bythe television (where the mobile phone B may use a scanning entryprovided by a third-party application (for example, a karaokeapplication), or may use a scanning entry provided by a system). Then,as shown in FIG. 18C, the mobile phone B may display a karaoke interface1804, and a profile photo 1805 (a profile photo of an account for thekaraoke application that the television logs in to or a profile photo ofa device account (for example, a HUAWEI account) that the televisionlogs in to) of the user A may be displayed at a deepest layer of lyrics,to indicate that the user A is currently singing a song. In response toan operation of tapping a “Sing” button 1806 by the user, as shown inFIG. 18D, the mobile phone B may display a pop-up box 1807. In responseto an operation of tapping a “Chorus” button 1808 by the user, as shownin FIG. 18E, a profile photo 1811 (the profile photo of the account forthe karaoke application that the television logs in to or the profilephoto of the device account (for example, the HUAWEI account) that thetelevision logs in to) of the user A and a profile photo 1810 (a profilephoto of an account for the karaoke application that the mobile phone Blogs in to or a profile photo of a device account (for example, a HUAWEIaccount) that the mobile phone B logs in to) of the user B indicate thatthe user B and the user A sing a same song together.

The following uses the karaoke application as an example to describe aspecific implementation of the application-level authentication methodprovided in embodiments of this disclosure. A method provided in anembodiment of this disclosure may be applied to two near-field devices,for example, a television and a mobile phone B. The television and themobile phone B are devices with different accounts (for example, withdifferent Huawei account), and a karaoke application is opened on boththe television and the mobile phone B. As shown in FIG. 19A to FIG. 19C,the method includes the following steps.

1901: A user selects a “Migrate” option in a karaoke interface of thetelevision.

For example, as shown in FIG. 18A, the user may select the “Migrate”option 1801 in the karaoke interface of the television (where the“Migrate” option 1801 is for migrating (sending) a series of karaokeinterfaces (where for example, the series of karaoke interfaces may beconsidered as FA9) of the television to another device (for example, themobile phone B)). The “Migrate” option may also be referred to as a“Share” option, a “Send” option, or the like. This is not limited inthis disclosure.

Optionally, the user may select the “Migrate” option through a controldevice (for example, a remote control or a mobile phone). Alternatively,if the television is a touch device, the user may directly tap the“Migrate” option to select the “Migrate” option.

Optionally, after selecting the “Migrate” option 1801, the user mayfurther select a device to which the series of karaoke interfaces are tobe migrated, for example, may select the mobile phone B.

1902: A two-dimensional code identification module of the televisioninitiates a two-dimensional code generation request to a HarmonyOS tagmanagement module of the television.

For example, input parameters of the two-dimensional code generationrequest include one bundle object and one asynchronous callback. Thebundle object includes a source package name (a local karaokeapplication package name) and a destination package name (a peer karaokeapplication package name or a package name of a to-be-migrated FA)required by a karaoke service. The asynchronous callback includes atwo-dimensional code creation result. If the two-dimensional code iscreated successfully, a two-dimensional code field may be obtained. Ifthe two-dimensional code fails to be created, an error code is obtained.

1903: The HarmonyOS tag management module of the television requestsdevice information of the television from a DM of the television.

The device information of the television may include a name, a networkID (netId), a device IP (deviceIP), and the like of the television.

The bundle object is for storing the device information obtained by theHarmonyOS tag management module to the device manager for creating agroup and subsequently sending information such as a client applicationpackage name to the peer device through a channel.

1904: The DM of the television generates a PIN.

The DM of the television may generate a random PIN. The PIN may be arandom number having several digits. Optionally, the DM of thetelevision may further generate a token, where the token may be a randomcharacter string having several bits.

1905: Optionally, the DM of the television calls a security managementmodule to obtain a local device connection parameter.

The local device connection parameter may include the network ID(netId), the device IP (deviceIP), a BLUETOOTH address (BtMac), and aWI-FI address (WI-FIPort) of the local device. The netId is storedlocally.

1906 a: The DM of the television calls the security management module tocreate the group.

The created group may be (local device name (namely, the television, forexample, HUAWEI TV), local karaoke application package name, (peerdevice name, which may be empty), peer karaoke application packagename/package name of the to-be-migrated FA). The group currently lacksat least one member, and another device is allowed to join the group asa member.

1906 b: Optionally, after successfully creating the group, the securitymanagement module sends a callback notification to the DM of thetelevision.

1907: After receiving the callback notification, the DM of thetelevision sends the PIN, the token, and the device information of thetelevision to the HarmonyOS tag management module.

The DM of the television stores a group name (groupName) locally, packsthe PIN, the token, and the device information of the television into abundle type, and transmits the bundle type to the HarmonyOS tagmanagement module through a callback by the device manager.

1908 a: The HarmonyOS tag management module generates a two-dimensionalcode image based on the PIN, the token, and the device information ofthe television.

1908 b: The HarmonyOS tag management module sends two-dimensional codeinformation to the two-dimensional code identification module.

1908 c: The two-dimensional code identification module generates thetwo-dimensional code image based on the two-dimensional code informationand displays the two-dimensional code image.

The two-dimensional code identification module may call a displayfunction of the television, to display the two-dimensional code image ona display screen of the television.

1909 a: The mobile phone B turns on a two-dimensional codeidentification module to scan the two-dimensional code image displayedby the television.

1909 b: The two-dimensional code identification module of the mobilephone B identifies the two-dimensional code information (or atwo-dimensional code tag) in the two-dimensional code image, triggers aHarmonyOS tag management module, and transfers the two-dimensional codeinformation into the HarmonyOS tag management module.

1909 c: The HarmonyOS tag management module parses the two-dimensionalcode information, and extracts a field (a character string) stored inthe two-dimensional code information.

1910: The HarmonyOS tag management module of the mobile phone B sends anauthentication request message to a DM of the mobile phone B andregisters a callback.

The authentication request message includes the field obtained byparsing the two-dimensional code information.

1911 a: The DM of the mobile phone B processes the authenticationrequest message.

The DM of the mobile phone B may split the field included in theauthentication request message to obtain deviceIp and WI-FIPort fields,and call an interface of a communication module based on the deviceIpand WI-FIPort fields to create a communication channel between themobile phone B and the television.

1911 b: Optionally, the DM of the mobile phone B sends an authenticationrequest message to the DM of the television through the communicationmodule.

The DM of the mobile phone B may set a token as a parameter requestId.It may be understood that the DM of the mobile phone B may further sendinformation such as a device ID of the mobile phone B to the DM of thetelevision through the communication module.

1912: Optionally, the DM of the television verifies the token.

The DM of the television extracts the token based on the parameterrequestId, compares the extracted token with the token stored locally,and if the tokens are consistent, agrees to create a securecommunication channel (where for example, the secure communicationchannel may be a communication channel protected through encryption)between the two devices (namely, the television and the mobile phone B),and sends group information to the mobile phone B through the securecommunication channel, where the group information includes the networkID of the television and a group ID (groupId), a group type (groupType),the group name (groupName), and the like of the group created by thetelevision.

1913: The DM of the mobile phone B receives and stores the groupinformation sent by the television.

1914: The DM of the mobile phone B calls a security management module toobtain all group information that has a trusted relationship with thepeer device, and then queries, through traversing using the securitymanagement module, whether the karaoke application of the television hasgroup access permission.

If the karaoke application of the television does not have thepermission, the device manager joins a specified group through HiChain.If the device manager successfully joins the group, an onFinish callbackof the devices at both ends is triggered. In this method, HiChain isinvoked to write package name information of the peer end for subsequentquery of an application-level trusted relationship. If the karaokeapplication of the television already has the permission, step 1915 isperformed.

1915: A DMS of the mobile phone B receives related information of FA9from a DEF of the television.

The related information of FA9 may include song information of karaoke,and the song information includes at least one of a song title (forexample, Hong Dou), lyrics, audio information, and video information.

Optionally, operations such as song pick-up and song cut-off performedon the mobile phone B and song list information are synchronously sentto the television through the secure communication channel, to controlmusic playing on a television side.

In some embodiments, if one of the television and the mobile phone Blogs in to an account (for example, a Huawei account), and the other onedoes not log in to the account, the television and the mobile phone Bmay perform step 1901 to step 1915. In this way, verification (namely,device-level authentication) is performed when the FA migration isperformed between the television and the mobile phone B, to ensuresecurity of data between the devices.

In some embodiments, if neither of the television and the mobile phone Blogs in to an account (for example, a HUAWEI account), the televisionand the mobile phone B may perform step 1901 to step 1915. In this way,verification is performed when the FA migration is performed between thetelevision and the mobile phone B, to ensure security of data betweenthe devices.

In some embodiments, if the television and the mobile phone B log in toa same account (for example, a HUAWEI account), the television and themobile phone B may perform step 1901 to step 1915. In this way,verification is performed when the FA migration is performed between thetelevision and the mobile phone B, to further ensure security of data(for example, the related information of the FA9) between the devices.

It should be noted that a part of step 1901 to step 1915 may beoptional, in other words, are not necessary technical features of thedevice-level authentication solution. For example, step 1905 may be anoptional step. For example, the DM of the television may obtain thelocal device connection parameter from another module. For anotherexample, step 1906 b may be an optional step, in other words, aftersuccessfully creating the group, the security management module may notsend the callback notification to the DM of the television. For anotherexample, step 1911 b and step 1912 may be optional steps, in otherwords, the DM of the mobile phone B may not send the token to the DM ofthe television, and the DM of the television does not need to verify thetoken.

Certainly, a mobile phone C (where the mobile phone C and the mobilephone B have different device accounts, for example, do not log in to asame HUAWEI account) may also join, by scanning a two-dimensional code,the group created by the television (where for a specific process, referto step 1809 to step 1818). In this way, a plurality of devices mayquickly trigger FA9 by scanning the two-dimensional code withoutpre-installation, to use a service immediately.

In addition, after scanning the two-dimensional code, the plurality ofdevices may establish a trust circle for information exchange. Forexample, information such as a song list may be updated and synchronizedin real time between the plurality of devices. The plurality of devices(for example, the mobile phone B or the mobile phone C) may coordinatelycontrol a chair end (for example, the television) to implementmulti-device collaborative control and achieve real mobile KTVexperience.

In some other embodiments, an initiator (an active migration device, forexample, the television) may generate the two-dimensional code image(for example, perform steps 1901 to 1908 c), and one or more receivers(one or more passive migration devices, for example, the mobile phone Band the mobile phone C) may perform authentication based on thetwo-dimensional code image of the television (for example, perform steps1909 a to 1914). After the authentication succeeds, the receiver maymigrate the shopping cart, the live streaming studio, the e-mail, or thelike to the television, so that information such as the shopping cart,the live stream, and the e-mail is shared between a plurality of devices(for example, the television, the mobile phone B, and the mobile phoneC). Information such as commodity information in a shopping cart, a livevideo stream, and e-mail content between the plurality of devices can beupdated and synchronized in real time, and the plurality of devices (forexample, the television, the mobile phone B, and the mobile phone C) maycollaboratively control a chair end (for example, the television), toimplement multi-device collaborative control and achieve real experienceof collaborative shopping, live streaming, or e-mail editing.

It should be noted that, for the UIs provided in embodiments of thisdisclosure, for example, FIG. 5A and FIG. 5B to FIG. 5L, FIG. 6A andFIG. 6B to FIG. 6D, FIG. 8A to FIG. 8G, FIG. 10A and FIG. 10B, FIG. 12Aand FIG. 12B to FIG. 12G, FIG. 14A to FIG. 14G, FIG. 16A to FIG. 16F,and FIG. 18A to FIG. 18C and FIG. 18D above, interface designs of theUIs are merely examples, and a location, a name, a shape, and the likeof each element (for example, a button, an icon, or text) in the UI arenot limited. For example, the button 802 (originally in the upper rightcorner of the interface 801) in FIG. 8A may alternatively be located ina lower right corner of the interface 801, and the text displayed on thebutton 802 may alternatively be “Share”, “Transfer”, or the like. Insome embodiments, elements of different UIs may be rearranged to becombined into a same UI. For example, the button 502 in FIG. 5A may bereplaced with the button 503 and the button 504 in FIG. 5B. A jumprelationship between the UIs is not limited in embodiments of thisdisclosure. For example, if a description, namely, jumping from a firstUI to a second UI, appears in embodiments of this disclosure, thedescription is merely an example of a jump relationship between thefirst interface and the second interface, and another jump relationshipis not limited. For example, as shown in FIG. 5F, in response to theoperation of tapping the “Bind” button 509 by the user, as shown in FIG.5H, the mobile phone may directly display the scanning interface 512. Amanner of jumping between the UIs is not limited in embodiments of thisdisclosure either (where for example, if a description, namely, tappinga first button in the first UI to jump to the second UI, appears inembodiments of this disclosure, the description is merely an example ofthe manner of jumping between the first interface and the secondinterface, and another jump manner is not limited). For example, asshown in FIG. 8A, in response to the operation performed by the userwith the specific gesture (for example, the three-finger sliding or theknuckle tapping), as shown in FIG. 8B, the mobile phone may display thepop-up box 803.

An embodiment of this disclosure provides a function migration method.As shown in FIG. 20 , the method includes the following steps.

2001: A first device sends a first request to a second device.

The first request carries an identifier of the first device, anidentifier of a first application, and an identifier of a secondapplication. The first request may be the authentication request messagein the foregoing embodiments, and related descriptions are not providedherein again.

In a possible implementation, a first pop-up box is displayed inresponse to a first operation performed by a user on the firstapplication of the first device, where the first pop-up box includes anidentifier of a device that is in a same network as the first device,and the first request is sent to the second device in response to asecond operation of selecting the second device by the user in the firstpop-up box. For example, the first pop-up box herein may be the pop-upbox 508 shown in FIG. 5F, the pop-up box 803 shown in FIG. 8B, or thelike.

The device that is in the same network as the first device includes atrusted device and an untrusted device, where the trusted deviceincludes a device that logs in to a same account as the first device, adevice that has performed device-level authentication with the firstdevice, or a device that has performed application-level authenticationwith the first application of the first device, and the untrusted deviceincludes a device that does not log in to the same account as the firstdevice, a device that has not performed device-level authentication withthe first device, or a device that has not performed application-levelauthentication with the first application of the first device. The firstdevice may be the mobile phone A in the foregoing embodiments.

2002: The second device receives the first request from the firstdevice.

After receiving the first request, the second device may display a firstpop-up box, where the first pop-up box notifies a user whether to agreeto add the first application of the first device to the first group, andreceive an agreement instruction from the user. For example, the firstpop-up box herein may be the pop-up box 531 shown in FIG. 6A, the pop-upbox 812 shown in FIG. 8D, or the like.

The second device may be the mobile phone B in the foregoingembodiments.

2003: The second device creates a first group, where a member in thefirst group includes the second application of the second device.

Before creating the first group, the second device may determine, basedon the identifier of the first device, that the second device currentlyhas no second group, where members in the second group include the firstdevice and the second device.

Before creating the first group, the second device may determine, basedon the identifier of the first device, the identifier of the firstapplication, and the identifier of the second application, that thesecond device currently has no third group, where members in the thirdgroup include the first application of the first device and the secondapplication of the second device.

2004: The second device sends a first response to the first device.

The first response may include a PIN corresponding to the first groupand/or communication connection information of the second device.

2005: The first device receives the first response from the seconddevice.

The first response indicates the first group created by the seconddevice, and the member in the first group includes the secondapplication of the second device.

2006: The first device sends a second request to the second device.

The second request is for applying for adding the first application ofthe first device to the first group.

In a possible implementation, the second device may display atwo-dimensional code image, where the two-dimensional code imageincludes the PIN corresponding to the first group and/or thecommunication connection information of the second device. The firstdevice may scan the two-dimensional code image displayed by the seconddevice, and obtain the PIN corresponding to the first group and/or thecommunication connection information of the second device. The firstdevice may send the second request to the second device based on the PINand/or the communication connection information of the second device.

Optionally, the first device sends the second request to the seconddevice based on the PIN and/or the communication connection informationof the second device.

2007: The second device receives the second request from the firstdevice.

The second device may add the first application of the first device tothe first group based on the second request.

Optionally, the second device may send a second response to the firstdevice, and the first device may receive the second response, where thesecond response indicates that the first application of the first devicehas joined the first group.

2008: The first device migrates a first function in the firstapplication to the second application of the second device, where thefirst function includes one or more UIs.

In a possible implementation, migrating a first function in the firstapplication to the second application of the second device includessending service information of the first function to the second device,where when the first application is a live streaming application, theservice information of the first function includes at least one of avideo stream, an audio stream, and bullet screen information of a livestreaming studio of the first device, when the first application is aphotographing application, the service information of the first functionincludes a photographing preview image or menu bar information of aphotographing interface, when the first application is a karaokeapplication, the service information of the first function includes atleast one of a song title, lyrics, audio information of a song, videoinformation of the song, and a control interface of the song, when thefirst application is a shopping application, the service information ofthe first function includes commodity information in a shopping cart, orwhen the first application is a mailbox application, the serviceinformation of the first function includes at least one of a subject,text, and an attachment of an e-mail.

Optionally, the first device may create a second group, where members inthe second group include the first application of the first device andthe second application of the second device.

2009: The second device receives the first function that is in the firstapplication and that is migrated by the first device, where the firstfunction includes the one or more UIs.

The first device and the second device in the embodiment in FIG. 20 maybe respectively the mobile phone A, the mobile phone B, and the like inthe foregoing embodiments. For a part that is not described in detail inthe embodiment in FIG. 20 , refer to the foregoing embodiments. Detailsare not described herein again.

An embodiment of this disclosure provides a function migration method.As shown in FIG. 21 , the method includes the following steps.

2101: A first device sends a first request to a second device.

The first request carries an identifier of the first device.

2102: The second device receives the first request from the firstdevice.

2103: The second device sends a first response to the first device.

The first response indicates a first group created by the second device,and a member in the first group includes the second device.

2104: The first device receives the first response from the seconddevice.

2105: The first device sends a second request to the second device,where the second request is for applying for adding the first device tothe first group.

2106: The first device migrates a first function in a first applicationto the second device, where the first application is any application inthe first device, and the first function includes one or more graphicalUIs.

The first device and the second device in the embodiment in FIG. 21 maybe respectively the mobile phone A, the mobile phone B, and the like inthe foregoing embodiments, and the first request may be theauthentication request message or the like in the foregoing embodiments.For a part that is not described in detail in the embodiment in FIG. 21, refer to the foregoing embodiments. Details are not described hereinagain.

An embodiment of this disclosure provides a function migration method.As shown in FIG. 22 , the method includes the following steps.

2201: A first device creates a first group, where a member in the firstgroup includes a first application of the first device.

2202: A second device sends a first request to the first device, wherethe first request is for applying for adding a second application of thesecond device to the first group created by the first device, andmembers in the first group include the first application of the firstdevice and the second application of the second device.

2203: The first device receives the first request from the seconddevice, where the first request is for applying for adding the secondapplication of the second device to the first group.

2204: The first device adds the second application of the second deviceto the first group.

2205: The first device migrates a first function in the firstapplication to the second application of the second device, where thefirst function includes one or more UIs.

2206: The second device receives the first function in the firstapplication from the first device, where the first function includes theone or more UIs.

The first device and the second device in the embodiment in FIG. 22 maybe respectively the mobile phone A, the mobile phone B, and the like inthe foregoing embodiments, and the first request may be theauthentication request message or the like in the foregoing embodiments.For a part that is not described in detail in the embodiment in FIG. 22, refer to the foregoing embodiments. Details are not described hereinagain.

Some other embodiments of this disclosure provide a first device or asecond device. The first device or the second device may be theelectronic device 200 shown in FIG. 3 . The first device or the seconddevice may include a communication module, a memory, and one or moreprocessors. The communication module, the memory, and the processor arecoupled. The memory is configured to store computer program code. Thecomputer program code includes computer instructions.

Another embodiment of this disclosure provides a chip system. As shownin FIG. 23 , the chip system includes at least one processor 2301 and atleast one interface circuit 2302. The processor 2301 and the interfacecircuit 2302 may be connected to each other through a line. For example,the interface circuit 2302 may be configured to receive a signal fromanother apparatus (for example, a memory of an electronic device). Foranother example, the interface circuit 2302 may be configured to send asignal to another apparatus (for example, the processor 2301).

For example, the interface circuit 2302 may read instructions stored inthe memory of the electronic device, and send the instructions to theprocessor 2301. When the instructions are executed by the processor2301, a first device/second device (the electronic device 230 shown inFIG. 6 ) may be enabled to perform the steps in the foregoingembodiments.

For another example, the interface circuit 2302 may read instructionsstored in a memory of a server, and send the instructions to theprocessor 2301. When the instructions are executed by the processor2301, the server may be enabled to perform the steps in the foregoingembodiments.

Certainly, the chip system may further include another discrete device.This is not limited in this embodiment of this disclosure.

The foregoing descriptions of the implementations allow a person skilledin the art to clearly understand that, for the purpose of convenient andbrief description, division into the foregoing functional modules isused as an example for description. During actual application, theforegoing functions may be allocated to different functional modulesbased on a requirement for implementation, that is, an inner structureof an apparatus is divided into different functional modules toimplement all or some of the functions described above.

In the several embodiments provided in this disclosure, it should beunderstood that the disclosed apparatus and method may be implemented inother manners. For example, the described apparatus embodiments aremerely examples. For example, division into the modules or units ismerely logical function division, and may be other division duringactual implementation. For example, a plurality of units or componentsmay be combined or may be integrated into another apparatus, or somefeatures may be ignored or not performed. In addition, the displayed ordiscussed mutual couplings or direct couplings or communicationconnections may be implemented by using some interfaces. The indirectcouplings or communication connections between the apparatuses or unitsmay be implemented in an electrical form, a mechanical form, or otherforms.

The units described as separate parts may or may not be physicallyseparate, and parts displayed as units may be one or more physicalunits, in other words, may be located in one place, or may bedistributed to a plurality of different places. Some or all of the unitsmay be selected based on actual requirements to achieve the objectivesof the solutions of embodiments.

In addition, functional units in embodiments of this disclosure may beintegrated into one processing unit, each of the units may exist alonephysically, or two or more units may be integrated into one unit. Theintegrated unit may be implemented in a form of hardware, or may beimplemented in a form of a software functional unit.

When the integrated unit is implemented in the form of the softwarefunctional unit and sold or used as an independent product, theintegrated unit may be stored in a readable storage medium. Based onsuch an understanding, the technical solutions in embodiments of thisdisclosure essentially, the part contributing to the other approaches,or all or some of the technical solutions may be implemented in a formof a software product. The software product is stored in a storagemedium and includes several instructions for instructing a device (whichmay be a single-chip microcomputer, a chip, or the like) or a processorto perform all or some of the steps of the methods described inembodiments of this disclosure. The foregoing storage medium includes:any medium that can store program code, such as a USB flash drive, aremovable hard disk, a read-only memory (ROM), a RAM, a magnetic disk,or an optical disc.

The foregoing content is merely specific implementations of thisdisclosure, but is not intended to limit the protection scope of thisdisclosure. Any variation or replacement within the technical scopedisclosed in this disclosure shall fall within the protection scope ofthis disclosure. Therefore, the protection scope of this disclosureshall be subject to the protection scope of the claims.

1. A method implemented by a first device and comprising: sending, to asecond device, a first request carrying a first identifier of the firstdevice, a second identifier of a first application of the first device,and a third identifier of a second application of the second device;receiving, from the second device, a first response indicating a firstgroup created by the second device, wherein first members of the firstgroup comprise the second application; sending, to the second device, asecond request requesting to add the first application to the firstgroup; and migrating a first function in the first application to thesecond application, wherein the first function comprises one or moregraphical user interfaces (GUIs).
 2. The method of claim 1, wherein thefirst response comprises a personal identification number (PIN)corresponding to the first group or communication connection informationof the second device, and wherein the second request comprises the PINor the communication connection information.
 3. The method of claim 1,further comprising receiving a second response indicating that the firstapplication has joined the first group.
 4. The method of claim 1,further comprising creating a second group, wherein second members ofthe second group comprise the first application and the secondapplication.
 5. The method of claim 1, further comprising: obtaining afirst operation of a user on the first application; displaying, inresponse to the first operation, a first pop-up box comprising a fourthidentifier of the second device; obtaining, from the user, a secondoperation of selecting the second device in the first pop-up box byselecting the fourth identifier; and further sending, to the seconddevice in response to the second operation, the first request.
 6. Themethod of claim 5, wherein the second device comprises a trusted deviceand an untrusted device, wherein the trusted device logs in to a sameaccount as the first device, has performed device-level authenticationwith the first device, or has performed application-level authenticationwith the first application, and wherein the untrusted device does notlog in to the same account as the first device, has not performed thedevice-level authentication with the first device, or a has notperformed the application-level authentication with the firstapplication.
 7. The method of claim 1, further comprising: scanning atwo-dimensional code picture displayed by the second device, wherein thetwo-dimensional code picture comprises a personal identification number(PIN) corresponding to the first group or communication connectioninformation of the second device; and further sending, to the seconddevice according to the PIN or the communication connection information,the second request.
 8. The method of claim 1, further comprisingsending, to the second device, service information of the firstfunction, wherein the service information comprises: at least one of avideo stream, an audio stream, or bullet screen information of a livebroadcast room of the first device when the first application is a livebroadcast application; menu bar information of a photographing previewpicture or a photographing interface when the first application is aphotographing application; at least one of a song name, a lyric, audioinformation of a song, video information of a song, or a controlinterface of a song when the first application is a karaoke application;commodity information in a shopping cart when the first application is ashopping application; and at least one of a subject, a body, or anattachment of an email when the first application is an emailapplication.
 9. A method implemented by a second device and comprising:receiving, from a first device, a first request carrying a firstidentifier of the first device, a second identifier of a firstapplication of the first device, and a third identifier of a secondapplication of the second device; creating a first group, wherein firstmembers of the first group comprise the second application; sending, tothe first device, a first response indicating the first group;receiving, from the first device, a second request requesting to add thefirst application to the first group; and receiving a first functionthat is in the first application and that is migrated by the firstdevice, wherein the first function comprises one or more graphical userinterfaces (GUIs).
 10. The method of claim 9, wherein the first responsecomprises a personal identification number (PIN) corresponding to thefirst group or communication connection information of the seconddevice.
 11. The method of claim 9, further comprising sending, to thefirst device, a second response indicating that the first applicationhas joined the first group.
 12. The method of claim 9, wherein afterreceiving the first request, the method further comprises: displaying afirst pop-up box prompting a user whether to agree to add the firstapplication to the first group; and receiving, from the user, consentinstruction.
 13. The method of claim 9, wherein before creating thefirst group, the method further comprises determining, according to thefirst identifier, that the second device currently does not have asecond group, and wherein second members of the second group comprisethe first device and the second device.
 14. The method of claim 9,wherein before creating the first group, the method further comprisesdetermining, according to the first identifier, the second identifier,and the third identifier, that the second device currently does not havea second group, and wherein second members of the second group comprisethe first application and the second application.
 15. The method ofclaim 9, further comprising displaying a two-dimensional code picture,wherein the two-dimensional code picture comprises a personalidentification number (PIN) corresponding to the first group orcommunication connection information of the second device.
 16. Themethod of claim 9, further comprising receiving, from the first device,service information of the first function, wherein the serviceinformation comprises: at least one of a video stream, an audio stream,or bullet screen information of a live broadcast room of the firstdevice when the first application is a live broadcast application; menubar information of a photographing preview picture or a photographinginterface when the first application is a photographing application; atleast one of a song name, a lyric, audio information of a song, videoinformation of a song, or a control interface of a song when the firstapplication is a karaoke application; commodity information in ashopping cart when the first application is a shopping application; andat least one of a subject, a body, or an attachment of an email when thefirst application is an email application.
 17. A first devicecomprising: a memory configured to store program instructions; one ormore processors coupled to the memory and configured to execute theprogram instructions to cause the first device to: send, to a seconddevice, a first request carrying a first identifier of the first device,a second identifier of a first application of the first device, and athird identifier of a second application of the second device; receive,from the second device, a first response indicating a first groupcreated by the second device, wherein first members of the first groupcomprise the second application; send, to the second device, a secondrequest requesting to add the first application to the first group; andmigrate a first function in the first application to the secondapplication, wherein the first function comprises one or more graphicaluser interfaces (GUIs).
 18. The first device of claim 17, wherein thefirst response comprises a personal identification number (PIN)corresponding to the first group or communication connection informationof the second device, and wherein the one or more processors are furtherconfigured to execute the program instruction to cause the first deviceto further send, to the second device according to the PIN or thecommunication connection information, the second request.
 19. The firstdevice of claim 17, wherein the one or more processors are furtherconfigured to execute the program instruction to cause the first deviceto receive a second response indicating that the first application hasjoined the first group.
 20. The first device of claim 17, wherein theone or more processors are further configured to execute the programinstruction to cause the first device to create a second group, andwherein second members of the second group comprise the firstapplication and the second application.